Re:KolibriOS – operating system written entirely in assembly...
by fractalb on Wednesday April 15, 2020 @04:19AM
(#22875629)
> Yes, and remember... optimizing for code size is optimizing for speed. =)
Not always. I think loop-unrolling is a common perf-optimisation technique. Even if the perf-gain is positive in this case, I highly suspect that it doesn't outweigh the cost of maintaining asm code(vs C/other higher level code).
edit: formatting
Re:KolibriOS – operating system written entirely in assembly...
by davedx on Wednesday April 15, 2020 @04:37AM
(#22875698)
Yep. I remember loop unrolling the skeletal animation code in libgdx way back resulted in a significant performance increase. And that was in Java
Re:KolibriOS – operating system written entirely in assembly...
by rurban on Wednesday April 15, 2020 @05:01AM
(#22875810)
More so inlining. Much more than loop unrolling.
Re:KolibriOS – operating system written entirely in assembly...
by jfkebwjsbx on Wednesday April 15, 2020 @06:06AM
(#22876097)
Optimizing for size is a local maximum in performance.
Re:KolibriOS – operating system written entirely in assembly...
by papermachete on Wednesday April 15, 2020 @11:23AM
(#22878800)
Less code doesn't imply faster code. GCC coreutils have blasted through openbsd coreutils for years.
Now we have CPUs with 256KB instruction cache and up. You can compile your whole OS at insane optimizations.
Re:KolibriOS – operating system written entirely in assembly...
by pjmlp on Wednesday April 15, 2020 @09:35AM
(#22877495)
There are some LLVM optimization talks that show otherwise, where longer vectorized code actually runs faster than the smaller version, though.
Re:KolibriOS – operating system written entirely in assembly...
by userbinator on Wednesday April 15, 2020 @09:46AM
(#22877622)
...in microbenchmarks.
That's what created multi-kilobyte memcpy() implementations, which barely beat REP MOVSB but cause huge icache bloat.
Smaller code and data = more CPU cache hits, which are orders of magnitude faster than fetching from RAM. So even if "all" you do is make code smaller, you can get more speed...