Alex313031 / Mercury

Firefox fork with compiler optimizations and patches from Librewolf, Waterfox, and GNU IceCat.
https://thorium.rocks/mercury
Mozilla Public License 2.0
1.02k stars 26 forks source link

AVX2 and SSE4 energy consumption #133

Closed trimechee closed 4 months ago

trimechee commented 4 months ago

It seems that avx 2 and sse4 can consume more power than the standard browser, do chrome and firefox use avx? and what version of SSE chrome and firefox use please ? SSE 3 ? the fan of my computer is noisy and I would like to use the version of Mercury browser which uses the least resources and energy to keep a computer silent please, which version of Mercury browser which uses the least resources do you recommend to me please Mr @Alex313031 ?Does standard firefox use less energy than Mercury ?

""One of my graduate school projects eventually became this answer: A side-by-side comparison of SSE2 (2-way SIMD) and AVX (4-way SIMD) did in fact show that AVX had a noticably higher power consumption and higher processor temperatures. (I don't remember the exact numbers though.)"

"For my computer, just keeping it on (idle) already draws more than half of what it can draw under an all-core SIMD load such as prime95 or Linpack. So if I can make an app 2x faster by means of SIMD/parallelization, I've almost certainly saved power."

"That's why most motherboards have an option called ‘AVX offset’ which downclocks the cores by a few hundred MHzs to mitigate any thermal increases."

https://stackoverflow.com/questions/19722950/do-sse-instructions-consume-more-power-energy

https://www.quora.com/Why-are-AVX-instructions-so-power-hungry

https://www.phoronix.com/review/rocket-lake-avx512/6

https://stackoverflow.com/questions/8389648/how-do-i-achieve-the-theoretical-maximum-of-4-flops-per-cycle/8391601#8391601

SashaXser commented 4 months ago

In fact, the power consumption is almost the same. If you want to verify this, wouldn't it be easier for you to run tests?

trimechee commented 4 months ago

@SashaXser the subject is not as simple as you think, there is scientific research on this subject and shared opinion, read the articles that I posted, can you give me your scientific proofs that avx2 does not consume more energy ?

SashaXser commented 4 months ago

read the articles that I posted

In this article, there is no difference in energy consumption. The rest of the sources are an attempt to answer your question, but without specific conclusions.

can you give me your scientific proofs that avx2 does not consume more energy ?

I don't have an Electricity power meter, if you have one, try running a simple test, I think it's very revealing.

trimechee commented 4 months ago

Interesting, thank you 👍

zakius commented 4 months ago

AVX heavy load indeed uses more power, but also it performs the same calculations much, much faster resulting in a lower energy consumption per load in most cases, and at worst in a great time savings

a browser won't make as much use of AVX for sure so the effects, both positive and negative, will be much less pronounced, but in general I'd say it's worth to make use of these when possible

trimechee commented 4 months ago

@zakius Interesting and very informative, thank you :) I close the issue

Girofox commented 3 months ago

Is it true that AVX2 instructions increase voltage on CPU cores? At least in OCCT stress test there is a difference and in ThrottleStop you can adjust AVX CPU clock offset. While doing Speedometer 3.0 i can't see any difference in temp and power usage though between AVX2 and SSE4 builds.