Eurecat / astar-gridmap-2d

A* algorithms for 2D gridmaps. The fastest one, until you prove me wrong
Apache License 2.0
57 stars 19 forks source link

hold reference to the world data instead of a copy #4

Closed chataign closed 5 years ago

chataign commented 5 years ago

when profiling i can see that astar spends ~25% of its time copying in setWorldData()

since our system has dynamic obstacles, the world data is recalculated almost before every call to findPath() so that 25% is a big cost

since the caller must generate and hold the world data, i propose that the library receives a reference to the data instead of copying

chataign commented 5 years ago

Hi any update on this? As you know we're on a tight schedule on this project so I need to be able to make changes more rapidly -- can I be a maintainer for this library? Otherwise i'll have to just pull a copy into our internal repo. Thanks

facontidavide commented 5 years ago

Can you run the benchmark and tell me how these changes affect it?

chataign commented 5 years ago

Running ./build/benchmark-astar Run on (4 X 3200 MHz CPU s) CPU Caches: L1 Data 32K (x2) L1 Instruction 32K (x2) L2 Unified 256K (x2) L3 Unified 4096K (x1) Load Average: 2.39, 2.33, 2.00 WARNING CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead. WARNING Library was built as DEBUG. Timings may be affected.

Benchmark Time CPU Iterations

BM_AStar_Big 3466388371 ns 3464068297 ns 1 BM_AStar_Smooth_1000 2667757300 ns 2666640280 ns 1 BM_AStar_Small 24274 ns 13564 ns 40870

chataign commented 5 years ago

these are the results, with a bunch of "Solution not found open set size= 0" before the 3rd test

the change is simply to avoid a deep copy of the world data, and let the caller manage that data

facontidavide commented 5 years ago

this is Eurecat repository and Eurecat has the copyright. I don't need to be the administrator anymore and I shouldn't care if you brake anything with your PR.

I will make you administrator

facontidavide commented 5 years ago

I removed myself from this project. Bye