Want to take part in these discussions? Sign in if you have an account, or apply for one below
Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
Since it appears you are mainly dealing with vectors here, the referencing feature is not suspicious. You may as well disable it completely by setting ILSettings.MinimumRefDimensions to 10 or so.
How did you measure the workload for single functions? With a profiler?
I assume, you are aware of the obstacles of measuring managed applications (in order to get comparable results)? Since most of the uncertainties are introduced by the garbage collector in the background. So we eventually cannot be sure, the workload is really produced by code from those functions. Rather it may be the GC dropping in while those functions are executed? You can make sure, by carefully profiling the GC and the managed heap size(s) as well. Here the windows performance counter snap-in can be a good friend. ..
* it appears, your application goes in direction of 'number chrunching' ? This is not the intended area for any managed math lib. Anyway, you are not lost ... ;)
* there is nothing wrong with the memory filling up! You bought the memory, why not use it? "stable at 40MB" is good for unmanaged applications. The managed heap will get used up completely before the GC automatically drops in. If it drops so often with such a small heap, there is the chance, it is triggered manually somewhere ? If yes, try to get around it!
* I suggest, you first try to disable the referencing feature (MinRefDimensions or by using ILNumericsLight). Let the memory grow and see, if you get any "stable" memory usage value - according to your problem size. Dont hesitate to let this limit look large. Do use the Pool! If you do not get any OutOfMemoryExceptions, everything is fine and this is the best you can easily get.
* Getting further is also possible - at the risk of getting wasteful as well...
No, just do ilX.Dispose & ilY.Dispose. Since these are vectors, they own individual storage, good for reusing on matching requests. If 'SampleData' size does not change, they can be used in the next cycle.
Also, could you please post your ILMemoryPool statistics? (http://ilnumerics.net/main.php?site=51432)
Jared, you of course are absolutely right! The subarray creation by now still have a lot of potential for performance improvements. So, f.e. by noting A[":;4"], an ILRange object is created first, than an ILIndexOffset is derived from that and stored in the destination array. ILRange probably (at least) is completely avoidable. Also, for regularly spaced ranges - as you found - addressing indices do not have to be stored explicitely. Right now this is done for simplicity only. (That way, it is possible to handle ALL referencing storages the same way, when one must find out the final index into the data array. On the other hand, there would be if-else cascascades or virtual function calls). So the whole subarray creation (referencing or not) might be another big area for future improvements ...
But the inherent problem still remains, even if the subarray creation would be more efficient. One way I am thinking of right now, would be to 'completely' avoid the "new" operator. This would imply to have all computational functions work on predefined storage and/or inline on incoming arrays. This is not done so far, since I could not figure out a way to make the nice operator overloads for ILArray work in that scheme too and not to loose the intuitive syntax. Possibly there will be 2 interfaces ...
1 to 10 of 10