timing experiments project

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
Post Reply
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

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)
Crying is not a proper retort!
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

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.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

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?
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

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
Crying is not a proper retort!
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

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
Last edited by digdug on Sun Mar 16, 2008 9:13 pm, edited 2 times in total.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

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)
Crying is not a proper retort!
Post Reply