- Is now MUCH faster
- No longer has the multi-gigabyte memory bloat
What I think was happening was that NinjaTrader caches things to improve performance. Unfortunately, that means the last reference to them never goes away, and so the temporary objects NEVER get garbage collected. (I even put in explicit calls to GC.Collect() and all they did was slow things down -- no improvement in memory footprint.)
That may be a sane performance tradeoff for a chart or a fairly small Market Analyzer, but is is a real loser for big Market Analyzers, such as mine (one 900 rows, the other 1600 rows, both about 10 columns -- most of which were my custom indicator with various periods). My custom indicator is not a problem in that scenario, but having it call LinRegSlope() was blowing size way up. Even a vastly simplified test case used more than 10GB, and took quite awhile to do so.
Anyway, now that I just call my own function instead of LinRegSlope() performance is quite acceptable for these Market Analyzers..
--EV
Comment