I've had problems recently with some of my code and thought it was a problem with esignal - but it was not esignal's problem.
I have an efs script that was averaging 26.x + ms per tick in the EFS Performance Monitor. Most of my other efs scripts average 2.0 or less.
Well, this efs is very complex and builds lots of arrays of data that can sometimes contain old, unnecessary, data.
So, I wrote a routine to sort and remove the extra data and only keep the needed data in the arrays. This increased the performance of my efs from 26ms to under 5ms per tick. Now I'm very happy.
So, the lesson learned here... when in doubt, you need to optimize the performance of your EFS because it can have a dramatic effect.
This also tells me that storing and looping thru unnecessary data can be a very common cause of slow efs/esignal operation.
There is no simple trick to optimizing an efs. Some of the most common techniques are :
_ Limiting code operation to only when necessary (once per bar or only when a certain condition is met)
_ Limiting the amount of data that is contained/stored in arrays. This helps to speed up array operations (like loops/whiles)
_ Limiting the amount of DRAW functions that are issued in your code. I've learned to create "drawonce" and "removeonce" features so I don't have my efs code constantly REDRAWING things.
_ Limiting external calls (to dlls or other) to only when needed or using timers (like every 7 seconds) so these calls are not made every tick.
_ Setting STAGES of operation within your EFS to SKIP certain portions of code based on whatever stage/mode your efs is in. For example, if you're long, you don't need to look for new long trades.
I hope this helps some of you "power users" out as I've learned a valuable lesson today. What I thought was an esignal problem turned out to be a problem with my EFS scripts and holding TOO MUCH DATA.
The new script is currently averaging 4.033 ms per tick... A BIG CHANGE from 26.5ms per tick. Dang arrays!! :P
I have an efs script that was averaging 26.x + ms per tick in the EFS Performance Monitor. Most of my other efs scripts average 2.0 or less.
Well, this efs is very complex and builds lots of arrays of data that can sometimes contain old, unnecessary, data.
So, I wrote a routine to sort and remove the extra data and only keep the needed data in the arrays. This increased the performance of my efs from 26ms to under 5ms per tick. Now I'm very happy.
So, the lesson learned here... when in doubt, you need to optimize the performance of your EFS because it can have a dramatic effect.
This also tells me that storing and looping thru unnecessary data can be a very common cause of slow efs/esignal operation.
There is no simple trick to optimizing an efs. Some of the most common techniques are :
_ Limiting code operation to only when necessary (once per bar or only when a certain condition is met)
_ Limiting the amount of data that is contained/stored in arrays. This helps to speed up array operations (like loops/whiles)
_ Limiting the amount of DRAW functions that are issued in your code. I've learned to create "drawonce" and "removeonce" features so I don't have my efs code constantly REDRAWING things.
_ Limiting external calls (to dlls or other) to only when needed or using timers (like every 7 seconds) so these calls are not made every tick.
_ Setting STAGES of operation within your EFS to SKIP certain portions of code based on whatever stage/mode your efs is in. For example, if you're long, you don't need to look for new long trades.
I hope this helps some of you "power users" out as I've learned a valuable lesson today. What I thought was an esignal problem turned out to be a problem with my EFS scripts and holding TOO MUCH DATA.
The new script is currently averaging 4.033 ms per tick... A BIG CHANGE from 26.5ms per tick. Dang arrays!! :P
Comment