[geos-devel] Benchmark between various geometry libraries

Mateusz Loskot mateusz at loskot.net
Wed Dec 9 11:32:42 EST 2009


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


More information about the geos-devel mailing list