Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re...
by ashishgautam0 on Monday August 21, 2023 @12:26AM
(#37205493)
Hey what's amdahl's law. Can you explain
[ Parent
| on HN ]
Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re...
by trostaft on Monday August 21, 2023 @12:30AM
(#37205510)
The Wikipedia article is pretty good, but tldr: "the overall performance improvement gained by optimizing a single part of a system is limited by the fraction of time that the improved part is actually used."
https://en.wikipedia.org/wiki/Amdahl%27s_law
Usually used in the parallel computing context, but works here too.
Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re...
by bombcar on Monday August 21, 2023 @12:33AM
(#37205525)
So if you have something that takes 1 second out of 10 seconds, you can't improve the overall system more than 1 second (by removing it entirely).
Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re...
by astrange on Monday August 21, 2023 @06:29AM
(#37207557)
That's not true, because in addition to taking 1 second it could be emptying all your caches. Performance isn't just adding up wallclock times.
Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re...
by robocat on Monday August 21, 2023 @04:00AM
(#37206604)
Same thing happens when driving - your trip duration usually depends on the slow bits not the faster parts e.g. in NZ driving through small towns will often be the longest part of your trip time.
Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re...
by _3u10 on Monday August 21, 2023 @12:31AM
(#37205516)
Something about 5% of things can’t be parallelized which then ends up dominating performance after the 95% of things that can be parallelized are.
Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re...
by mumumu on Monday August 21, 2023 @01:00AM
(#37205656)
In hardware engineering this is called critical path.
Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re...
by memefrog on Monday August 21, 2023 @01:29AM
(#37205777)
That is about latency, but Amdahl's law is about throughput I think.
Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re...
by CyberDildonics on Monday August 21, 2023 @09:05AM
(#37209018)
Amdahl's law is not about latency or throughput, it is about optimizing one part of a program having diminishing returns relative to the part that isn't optimized. It is not really a law, it is more common sense that most people would never assume needs to be explicitly said.
Re:FreeBSD replaces bubblesort with mergesort on SYSINTs, re...
by mumumu on Monday August 21, 2023 @12:56AM
(#37205635)
Amdahl's law is common sense, but also the one of the reasons premature optimization is the root of all evil.
A small speedup on the longest (by time) part of the program is usually better than infinite speedup on a short part of the program.