Page 1 of 1

timing experiments project

Posted: Fri Mar 14, 2008 10:57 pm
by Betelgeuse
I was wondering if anyone would be interested in working on some timing tests so we can know how long things take. We would measure in ticks.

Here are some tests we can work on are there any others that you would like to know?

How long does it take
to call a function?
to call a function with eval?
to allocate one temp variable?

What are the various control structures overheads?
Does the length of a functions name make a difference?
Does the amount of functions effect the time to call?
Does more complex criteria slow the functions that use them?
Does sysFindObj take longer in busier systems?

Does the length of names in static data/event effect the amount of time it takes to get/call?
Does the amount of events or static data on a given station effect the time it takes to call or get?

Do different timer amounts matter after you take way the time to run the event? (ie a reoccurring event every 1000 ticks and a reoccurring event every 10 ticks)

Posted: Sat Mar 15, 2008 5:21 am
by Periculi
As it turns out, I am working with timers at the moment, so maybe we could help each other out. I could use some list manipulation script help, and would be willing to perform some tests and keep track of ticks for you. I could easily use a few functions that measured from unvGetTick as I develop the calendar, passive update, and active update events mods I have in progress.

Posted: Sat Mar 15, 2008 5:29 pm
by Betelgeuse
well as long as the results can be replicated by others I don't care how it is done.
8)

Do you have any other timing questions you can think of?

Posted: Sat Mar 15, 2008 9:07 pm
by Betelgeuse
here are some tests that digdug did (everything is in systicks on his computer)

a for loop that goes 1000000 iterations 188

going 1000000 times

variable that doesn't change 156
variable that does change 281
setq a variable 1202
calling a empty function 265 (a function that does nothing)
calling the above function with eval 3702
calling the above function with apply 3000
calling an empty function with a name longer than 300 characters 265
empty block with no temp variables 312
if with Nil inside it 374
(cat "name" i) 4718
objGetData 4875

Posted: Sat Mar 15, 2008 11:08 pm
by digdug
for loop that goes 1,000,000 iterations (game in pause during test, all values are in ticks)

calling an empty function in a block 781
calling 2 empty functions in a block 1046
calling 3 empty functions in a block 1343
a loop with a comment ; 0
a loop with a comment <!-- --> 0
allocating a temp variable in an empty block 984
allocating 2 temp variables in an empty block 1468
allocating 3 temp variables in an empty block 2062



I uploaded to xelerus the 21 tests we did in a single extension mod, so everybody can do their own timing tests :)
http://xelerus.de/index.php?s=mod&id=99

Please do not call the timetest16 (objSetData) as it will half crash transcendance !
See this for the overflow that me and Betel found:
http://www.neurohack.com/transcendence/ ... php?t=1379

Posted: Sat Mar 15, 2008 11:38 pm
by Betelgeuse
we also found that empty block with no temp variables takes a shortcut over a block with Nil in it (over what just Nil would contribute)