jameschch / LeanOptimization

Genetic optimization using LEAN
Apache License 2.0
50 stars 14 forks source link

performance testing and tuning #11

Closed jameschch closed 4 years ago

jameschch commented 7 years ago

Perform in depth performance testing of optimizer to improve backtest performance using a range of approaches and factors:

-ram disk for data folder -trimmed down Lean client -max threads -maximum memory limit -hotspots in optimizer code

worthy7 commented 7 years ago

James could you explain a little bit how it works at the moment? I saw it using around 10.5 gb of ram yesterday, I cannot imagine why it needed that much memory tbh. I assumed that the data feeds were just one feed going into all threads at the same time (one read but all the data was shared).

jameschch commented 7 years ago

I always run optimizations with a local data set. Also I have charting disabled as this will also consume resources. As a rule of thumb I believe you should set max threads in config to your CPU cores. I do not recommend long running optimizations with a debugger attached.

One of the upcoming tasks is performance profiling and optimization: feel free to provide some numbers for this using different settings.

On 10 April 2017 01:22:05 BST, Worthy7 notifications@github.com wrote:

James could you explain a little bit how it works at the moment? I saw it using around 10.5 gb of ram yesterday, I cannot imagine why it needed that much memory tbh. I assumed that the data feeds were just one feed going into all threads at the same time (one read but all the data was shared).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/jameschch/LeanOptimization/issues/11#issuecomment-292824159, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APvtWHJFN2wHcKYRwqtXIw7OanI0oxBdks5ruXYtgaJpZM4MyFBU.

worthy7 commented 7 years ago

By local data set you mean a downloaded one? I did have charting disabled. Max threads was at 8, my cpu is 4 cores but because of... Hyperthreading? it can work well with 8 threads I believe. No debugger attached. Are you saying my 10.5gb of usage was abnormal?

Regarding the data streams, is this the heaviest part of the system in terms of ram usage?

jameschch commented 7 years ago

I'm not getting memory problems so am guessing what the differences are. Its worth dropping down the max threads as this is essentially the number of parallel backrests.

On 11 April 2017 01:30:41 BST, Worthy7 notifications@github.com wrote:

By local data set you mean a downloaded one? I did have charting disabled. Max threads was at 8, my cpu is 4 cores but because of... Hyperthreading? it can work well with 8 threads I believe. No debugger attached. Are you saying my 10.5gb of usage was abnormal?

Regarding the data streams, is this the heaviest part of the system in terms of ram usage?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/jameschch/LeanOptimization/issues/11#issuecomment-293116039, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APvtWFLKzWTUFwIxe7Rk2bkIyRMFj2Gxks5rusmxgaJpZM4MyFBU.

worthy7 commented 7 years ago

So is this normal behavior? Even if I drop the threads, 8-> 1, that takes it to 1.5gb ish. That seems overkill too.

jameschch commented 7 years ago

How does this compare to memory usage of a standard lean backtest?

On 12 April 2017 01:06:44 BST, Worthy7 notifications@github.com wrote:

So is this normal behavior? Even if I drop the threads, 8-> 1, that takes it to 1.5gb ish. That seems overkill too.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/jameschch/LeanOptimization/issues/11#issuecomment-293435131, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APvtWJ8PgNLPLC2qhReUoC3q8i1kaSyFks5rvBWUgaJpZM4MyFBU.