[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT2 performance for number crunching
- From: Mike Pall <mikelu-1102@...>
- Date: Sun, 13 Feb 2011 16:51:35 +0100
Miles Bader wrote:
> Mike Pall <email@example.com> writes:
> > In C++ one would use templates for that purpose. This instantiates
> > a copy of the whole code for a specific number of dimensons.
> > That's not as wasteful as it sounds, since you probably only ever
> > use a finite set of dimensions, e.g. dim=2 and dim=3
> To be fair, gcc at least will happily unroll small fixed loops like
> this, and usually does, to the extent that I've stopped trying to use
> any kind of special technique, and just write the obvious loops when
> programming in C++.
Only if the loop count is known to be constant. But it isn't here,
since it's user-specified.