Performance

dj_d

Member
I'm working on a script that iterates over a ton of calculations (a la eatdrink, but worse). It takes about an hour to run (fortunately with no server impact). I'm looking for some low hanging fruit to speed it up. Any tips? I'm interested in both ways to profile performance, if there are any, and stuff in ASH that might be slow that I wouldn't expect. For example, print statements? map operations? integer math?
 

Catch-22

Active member
I'm working on a script that iterates over a ton of calculations (a la eatdrink, but worse). It takes about an hour to run (fortunately with no server impact). I'm looking for some low hanging fruit to speed it up. Any tips? I'm interested in both ways to profile performance, if there are any, and stuff in ASH that might be slow that I wouldn't expect. For example, print statements? map operations? integer math?

String concatenation, possibly, if you're doing a lot of it. Are you able to post some snippets of what you think could do with some optimization? Do you have any functions that are being called in a loop etc. and you think the function could be more efficient?

Also see if turning off logging makes a difference, at least then you can rule some things out.
 
Last edited:

dj_d

Member
A good start might just be a command to print the system clock to whatever level of accuracy is available.
 

Catch-22

Active member
A good start might just be a command to print the system clock to whatever level of accuracy is available.

today_to_string() will print the system clock to the accuracy of 1 day ;)

I still think print timestamp is broken...
 
Top