maliput / maliput-rs

Rust bindings for maliput and other tools
https://maliput.github.io/maliput-rs/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Adds to_road_position benchmark. #42

Closed francocipollone closed 7 months ago

francocipollone commented 7 months ago

🎉 New feature

Closes #41

Summary

Test it

cargo bench

Check target/cursarion/report folder

image

It can be compared with Cpp execution via maliput_query app (part of maliput_integration):

maliput_query --maliput_backend=malidrive --xodr_file_path=Town01.xodr -- ToRoadPosition 5 0 0
[INFO] Loading road network using malidrive backend implementation...
[INFO] RoadNetwork loaded successfully.
ToRoadPosition(inertial_position: (x = 5, y = 0, z = 0))
              : Result: nearest_pos:(x = 5, y = 5.27988e-08, z = 0) with distance: 1.33039e-07
                RoadPosition: (lane: 13_0_1, lane_pos: (s = 13.7415, r = -1.14409, h = 0))
Elapsed Query Time: 0.0127387 s

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

francocipollone commented 7 months ago

LGTM, but do you want to bring in that dependency for something we could do with std::time::Instant::now() and elapsed()?

It is true I don't have a requirement to use that dependency, the metrics I used are simple enough. It was a mere "let's see how in general benchmarks are created in rust" At the same time, It's a dev-dependency that would only affect the maintainers/developers. I don't see much harm.