[geos-devel] Benchmark between various geometry libraries
Maxime van Noppen
maxime at altribe.org
Thu Nov 19 06:25:29 EST 2009
Hartmut Kaiser wrote:
> Well, as both allocators the one in JVM and the one used by the C++ compiler is probably written in C or C++ I don't see why Java should be soo much faster when it comes to allocating objects :-P
It's not that the allocator is faster but that the JVM has a pool of
preallocated space and objects that it can use and reuse, therefore
being much faster in long-term runs.
> The vector internally will allocate from the heap, yes, but the vector itself doesn't have to be allocated this way. If you avoid that you just remove half of the memory allocations...
And more than that : the vector will use the allocators smartly which
means you won't have N allocations for N push_backs on the vector (there
will be a slight memory overhead though, which makes vector of vectors
less interesting).
--
Maxime
More information about the geos-devel
mailing list