[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Is pic related true with gcc 7? I started using Gentoo about

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 12
Thread images: 1

File: optimization.jpg (45KB, 640x675px) Image search: [Google]
optimization.jpg
45KB, 640x675px
Is pic related true with gcc 7?

I started using Gentoo about six months ago and so far I've been just using -O2 -pipe -march=native as advised on the wiki. I'm considering trying -O3, but most of the discussion I can find about the practical effects of enabling it in make.conf is 10 years old and seemingly not applicable to modern GCC versions, which have obviously changed a lot.

I'm using an SSD so binary size isn't so important. I also don't mind if it breaks a few packages since I can easily switch those to -O2. The question is, as in the pic, whether it should be used as a general optimization flag.
>>
>>60717189
That's a good question. Test a few out and report back your findings. Compare binary size and performing the same tasks the same number of times.

What would be a complex but easily scriptable test program?
>>
>>60717260
Professor?
>>
>>60717260
I've seen benchmarks for a few apps on Phoronix that generally give an edge to -O3. Given that the effects vary per app I'm not sure how feasible a system-wide benchmark would be.

And AFAIK the increase in binary size is pretty modest with just -O3, as stuff like -funroll-all-loops isn't included. Plus using -march=native is supposed to help because it lets GCC take the CPU cache size into account.
>>
Yes gcc 7 didn't change anything in that regard.
>>
>>60717189
Never use -O3, just my two cents
>>
I use -Ofast get on my level

http://gentoo.no-ip.org
>>
>>60717863
Is this your own repo or something?
>>
>>60717863
-Ofast breaks standard-compliant programs unlike -O3 and can produce incorrect results. Better to turn it on for specific packages only. It only helps if a lot of floating-point operations are done anyway.
>>
>>60717189
No, unless you never need things like TCO. So it can be safer as well. Generally I'd run both to see what's faster, if I'm worried, as it depends too much on what you write.
>>
>>60717189
>practical effects
perhaps if your're compiling for an embedded system, then the smaller binary size and additional inconsequental compliation overhead wouldn't be an issue

but on a main rig, perhaps you should set your -march=native to your actual cpu like --march=haswell and specify your cflags to really get your processer cranking on the job, don't forget to add the latest microcode aswell
>>
>>60717189
You rather it runs fast or runs correctly? O2 is much less likely to produce incorrect code, and the difference in performance is quite minor.
Thread posts: 12
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.