[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.4.2 New assorted suggestions (Part II)
- From: Gé Weijers <ge@...>
- Date: Mon, 23 Nov 2020 09:21:32 -0800
On Mon, Nov 23, 2020 at 8:53 AM Will Crowder <will@crowder-design.com> wrote:
> Back when C really was just "the greatest macroassembler ever written," code-level micro-optimizations made sense. But compiler technology has come a long way since then.
I remember when you could predict the code generated by the original
PDP-11 C compiler on the 7th edition Unix system. Adding "register"
variables and using post-increment or pre-decrement on pointers could
really speed up your code. That's no longer the case, the compiler
often has a better grasp on the behavior of modern CPUs than the
programmer. You can 'optimize' your code only to find that you added
dependencies between instructions that lead to more pipeline stalls or
that the "optimized" code grew the data structure beyond your cache
size, leading to lots of cache misses. An optimization for one
architecture can make things worse on another as well.
--
Gé
- References:
- Lua 5.4.2 New assorted suggestions (Part II), Ranier Vilela
- Re: Lua 5.4.2 New assorted suggestions (Part II), Dibyendu Majumdar
- Re: Lua 5.4.2 New assorted suggestions (Part II), Ranier Vilela
- Re: Lua 5.4.2 New assorted suggestions (Part II), Dibyendu Majumdar
- Re: Lua 5.4.2 New assorted suggestions (Part II), Ranier Vilela
- Re: Lua 5.4.2 New assorted suggestions (Part II), Chris Smith
- Re: Lua 5.4.2 New assorted suggestions (Part II), Luiz Henrique de Figueiredo
- Re: Lua 5.4.2 New assorted suggestions (Part II), eugeny gladkih
- Re: Lua 5.4.2 New assorted suggestions (Part II), Roberto Ierusalimschy
- Re: Lua 5.4.2 New assorted suggestions (Part II), Ranier Vilela
- Re: Lua 5.4.2 New assorted suggestions (Part II), Luiz Henrique de Figueiredo
- Re: Lua 5.4.2 New assorted suggestions (Part II), Ranier Vilela
- Re: Lua 5.4.2 New assorted suggestions (Part II), Kyle Evans
- Re: Lua 5.4.2 New assorted suggestions (Part II), Ranier Vilela
- Re: Lua 5.4.2 New assorted suggestions (Part II), Kyle Evans
- Re: Lua 5.4.2 New assorted suggestions (Part II), Ranier Vilela
- Re: Lua 5.4.2 New assorted suggestions (Part II), Kyle Evans
- Re: Lua 5.4.2 New assorted suggestions (Part II), Will Crowder