lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Dec 19, 2014 at 12:32 AM, Jay Carlson <nop@nop.com> wrote:
On Dec 17, 2014, at 5:28 AM, Daniel Silverstone <dsilvers@digital-scurf.org> wrote:
> It's also almost always slower than non PIC code on all but x86_32.  Unless
> you're building a shared library or a position independent executable, don't
> use -fPIC.

In God we trust. All else bring math.

 I got curious, so I did a little experiment (Lua 5.2.3, Linux/x86_64). For whatever it's worth:

**** without -fPIC
time ./lua -e 'for i=0,1e9 do x=i+1 end'
real 0m33.197s
user 0m33.124s
sys 0m0.036s


**** with -fPIC
time ./lua -e 'for i=0,1e9 do x=i+1 end'
real 0m36.279s
user 0m36.173s
sys 0m0.068s

So -fPIC makes this little test about 10% slower on my machine.

-Ricardo