strk wrote:
On Wed, Dec 09, 2009 at 05:13:15PM +0100, Maxime van Noppen wrote:
Maxime van Noppen wrote:
I will post any numbers I get.
I'm still far from having a solid and complete report but just to give
you a taste : on 100 intersections dynamic allocations represent 25.01%
of the time cost (17.14% spent allocating, 7.87% deallocating).

I've also found several small optimizations that can lead to significant
performance boosts. For example, on the 100 intersection benchmark I
found that 10% of the time was spent in CoordinateArraySequence::getAt.
The fact is that as the code is in the .cpp file it cannot be inlined by
the compiler. So I juste moved the one-line code of the .cpp file to the
.h file and the runtime cost dropped drastically (to ~ 2%).

CoordinateArraySequence::getAt is a virtual function, which is probably
the reason why the fully templated solution is much faster instead.

How can a virtual method be inlined by the compiler ?

If compiler is able to determine exact type...

http://www.parashift.com/c++-faq-lite/value-vs-ref-semantics.html#faq-31.6

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
geos-devel mailing list
geos-devel@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/geos-devel

Reply via email to