Re: LuaJIT 2 ffi (casting / force hotpath)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: LuaJIT 2 ffi (casting / force hotpath)
- From: Miles Bader <miles@...>
- Date: 2011年1月16日 08:44:12 +0900
Mike Pall <mikelu-1101@mike.de> writes:
> A C compiler easily gets into trouble with pointer aliasing and
> needs some expensive analysis to turn this back into the original
> index expression the programmer tried to 'optimize'. :-)
>
> Morale: what a programmer may think is helpful for the compiler,
> often is not. So write things in the most straightforward way.
Sure, but often the goal is not "optimization", but clarity -- if the
factored-out expression is long, it can be significantly harder to read
code without the factoring-out. [I.e., "straightforward" doesn't
always equal "readable"]
-miles
--
Admiration, n. Our polite recognition of another's resemblance to ourselves.