emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#38322: closed (GCC optimize levels makes huge impact on performance)


From: GNU bug Tracking System
Subject: bug#38322: closed (GCC optimize levels makes huge impact on performance)
Date: Thu, 02 Jan 2020 10:09:02 +0000

Your message dated Thu, 2 Jan 2020 02:08:27 -0800
with message-id <address@hidden>
and subject line Re: bug#38322: GCC optimize levels makes huge impact on 
performance
has caused the debbugs.gnu.org bug report #38322,
regarding GCC optimize levels makes huge impact on performance
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden.)


-- 
38322: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38322
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: GCC optimize levels makes huge impact on performance Date: Fri, 22 Nov 2019 18:00:29 +0200
Hello there!

Today I was working on two bigger, plain text, csv-like database files
(file1: ~175k lines and 15MB, file2: ~ 168k lines and 14MB). I just
searched for lines, using grep -f $file2 $file1. I was so surprised
when I realized the search was running for minutes already without a
single line at the standard output. I decided to have a try with
custom compiled binaries, because in my mind the size optimized
binaries are the fastest.
In the end grep (3.1) was running for:
- 4m50s if I used the one was coming from Ubuntu,
- 4m29s in case of custom recompiled with GCC7.4 and CFLAGS="O2" and
- 3m17s in case of custom recompiled with GCC7.4 and CFLAGS="Os".
I repeated the runs multiple times, I would say it's accurate. The
files were located on tmpfs.
Binary sizes are: 215K for Ubuntu, 184K for O2 and 150K for Os.
CPU: Intel I5-8350U
OS: Ubuntu 18.04.3 LTS
Would you mind change the default optimize level on the make
configuration? Did somebody ever measured the benefits using different
GCC optimalization levels?
I know that this is a special use case, but the improvement is huge.
I'm looking forward for your feedback.

Best regards



--- End Message ---
--- Begin Message --- Subject: Re: bug#38322: GCC optimize levels makes huge impact on performance Date: Thu, 2 Jan 2020 02:08:27 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2
On 11/22/19 5:52 PM, Paul Eggert wrote:
> If we do want to tune grep for set-like operations, that suggests doing some
> surgery to its internals rather than merely fiddling with -O flags.

Since I last wrote, some of that surgery has been done by another grep
contributor, and a simple 'grep -f file1 file2' benchmark that I just now tried
sped up from 47 seconds (for grep 3.1) to 2.3 seconds (for the next version of
grep). So this algorithmic change should far outweigh any GCC optimization level
change.

Anyway, the topic seems to have died down so I'm closing the bug report.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]