Performance: New Functions between old style coding...

Case number:954892-990162
Topic:Developer Preview
Opened by:Darkknight900
Opened on:Thursday, August 11, 2011 - 11:58
Last modified:Thursday, August 16, 2012 - 15:53

I just added 2 recipes for some benchmark tests.

I just want to point out again that these functions are really useful in some complex ways where we need to use more code without them BUT the benchmarks show that these functions are really slow... Test yourself... increase iterations when you don't see any differences...

I just wanted to point this out because we need to resolve this performance issue.

And surely the functions are in some way slower but i dont think that they are that slow...

Btw. i just want to optimize my recipes so the real working functions can be used as much as possible.

(Thu, 08/11/2011 - 11:58  |  4 comments)

Joined: 06/17/2010

Much slower using ipairs than for #table... it is 10x slower!

Joined: 11/10/2007
Groups: Window Group
Status: Open » Open

We will look into performance improvements.

Joined: 08/29/2010

Tried again and i think there weren't any performance improvements done...

Can someone explain why we should use them or are they for some special operations needed? To my mind these functions are just useless because we can do the same work with other code faster.

Also sorting table can be done faster with some more code than with the ipair iteration...

brow42's picture
User offline. Last seen 1 year 36 weeks ago. Offline
Joined: 09/19/2011
Groups: None

Since ipairs is identical to for 1,# (it even stops at the first nil) I never use this. I do use pairs and there is no good replacement for this (I'd need a second table of keys).

I always use table.sort for sorting unless I know I only have values 1-N with no holes.

difftime seems poorly conceived by the Lua designers. There seems to be no portable way to a time difference in seconds. Fortunately, it seems the implementation dependent os.time returns seconds on all common platforms.


Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, Boehringer Ingelheim, RosettaCommons