Hi,
It took me a while to refactor the selection tools. Changes are
- use generics instead of OJ CollectionMap (hopefully, it makes the code
more readable)
- save a lot of memory (initializing lists and sets with size=1 instead
of default size)
- fixed old bug 2792806
Of course, I may have missed something. Let me know if you see any
strange behaviour.
here is a commented test case showing how EditTransaction and Selection
Tools refactoring improved the situation
Test is done with a 187000 small polygons dataset.
Times (sec) | Memory (Mb)
1.4.2 1.4.3alpha| 1.4.2 1.4.3alpha
--------------------------------------------
1-ini 0 0 | 10 11
2-load 2 2 | 105 106
3-select all 2 2 | 179 148
4-copy all 31 31 | 260 161
5-combine 10 11 | 124 122
6-explode 160 6 | 381 196
7-unselect 1 1 | 310 156
8-new layer 1 1 | 121 120
3-select all : selection maps features with 1 to 3 Sets of item indices.
Initializing sets with size 1 save 32Mb (+42Mb instead of +74Mb)
Note : we can probably save more with a special implementation of
FeatureSelection
4 -copy all items : for a reason, copying selected items duplicated
the selection structures (+13Mb in 1.4.3alpha instead of 81Mb in
1.4.2 !)
Note : time is still high, because all geometries are converted to
WKT in the clipboard
5-memory usage is much lower after "combine", even in 1.4.2, because wasted
memory depends on the number of selected features (287000 -> 1)
6-exlplode time decreases from 160 s to 6 s because list.contains
has been replace by set.contains in EditTransaction
memory usage is +64Mb in 1.4.3alpha instead of +257Mb
thanks to EditTransaction refactoring
8-memory usage decreases after new layer command (even in 1.4.2)
because EditTransaction memory is cleared. Be careful,
it also means that undo chain is broken after such a command.
Michaël
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel