Boost logo

Geometry :

Subject: Re: [geometry] [index] Rtree insert performance super slow on example
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2015-02-12 13:19:55


Hi Mark,

Mark Mccann wrote:
> I’m attempting to use the boost spatial index for the first time. Typically, my program will need to build an rtree with about 500K or so boxes or points and then make many queries. According to the the documentation, the time to insert 1 M boxes should be on the order of ~1 second:
>
> http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/spatial_indexes/introduction.html
>
> However, on my machines, I’m typically seeing index build times of > 30 seconds.
>
> In this 2014 post: http://boost-geometry.203548.n3.nabble.com/index-rtree-news-tt4026001.html
> Adam reports the follow run times from his benchmarking example for boxes and segments:
>
> BOXES SEGMENTS
> 0.436803 seconds 0.468003 seconds pack 1000000
> 0.0624004 seconds 0.0780005 seconds query(B)* 100000 found 100046
> 1.43521 seconds 1.49761 seconds insert 1000000
> 0.748805 seconds 0.967206 seconds query(B) 100000 found 100046
>
> However, i’m seeing performance that is ~20x slower when compiling and running the same code:
> ~/geometry/index/example] ./benchmark_experimental
> 2.73026 seconds - pack 1000000
> 1.32293 seconds - query(B) 100000 found 100046
> 34.0913 seconds - insert 1000000
> 10.7422 seconds - query(B) 100000 found 100046
>
> My machine is older, but is this old enough to result in this massively slow performance?
> I’m compiling on OS X 10.10 with a 2 x 2.93 GHz Quad-Core Intel Xeon and 32 GB of DDR3 memory. The machine is circa 2009, but it was absolutely the fastest available at the time.
>
> Any help would be appreciated or pointers to old discussions that would help.

I'm assuming you're testing Boost 1.57.
What compiler are you using (probably clang) and what parameters are
passed into it?
Is optimization enabled?
Indeed in the documentation it's not mentioned that the optimization
level /O2 was enabled while gathering those results.

Regards,
Adam


Geometry list run by mateusz at loskot.net