Skip to content

[BREAKING CHANGE] remove 'SizeLimit' trait #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from

Conversation

danieleades
Copy link
Contributor

@danieleades danieleades commented Jun 28, 2023

i've been playing around with simplifying by removing the 'SizeLimit' trait, and using an Option<u64> instead

this removes around 100 lines of code, and reduces the complexity of the trait bounds

@danieleades danieleades changed the title remove 'SizeLimit' trait [BREAKING CHANGE] remove 'SizeLimit' trait Jun 28, 2023
@danieleades danieleades marked this pull request as ready for review June 28, 2023 23:00
@hrektts
Copy link
Owner

hrektts commented Jun 29, 2023

Thanks for the refactoring! This change slows down the benchmark in my environment. I will revisit this after #25 is landed.

@danieleades
Copy link
Contributor Author

Thanks for the refactoring! This change slows down the benchmark in my environment. I will revisit this after #25 is landed.

interesting...
if it turns out to be statistically significant, i'd be interested in trying to figure out where the slow-down is being introduced

@danieleades
Copy link
Contributor Author

bit of a mixed bag, but definitely seems to be a net regression-

     Running benches/bench.rs (target/release/deps/bench-90251808a77ebfbb)
Gnuplot not found, using plotters backend
lidar point msg         time:   [658.58 µs 661.62 µs 666.26 µs]
                        change: [+48.713% +51.940% +55.274%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 17 outliers among 100 measurements (17.00%)
  2 (2.00%) low mild
  2 (2.00%) high mild
  13 (13.00%) high severe

lidar point msg without encapsulation
                        time:   [658.35 µs 660.57 µs 663.21 µs]
                        change: [+49.533% +52.255% +54.988%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 16 outliers among 100 measurements (16.00%)
  7 (7.00%) high mild
  9 (9.00%) high severe

lidar point msg bincode time:   [180.26 µs 180.56 µs 180.89 µs]
                        change: [-14.068% -12.981% -11.878%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 19 outliers among 100 measurements (19.00%)
  5 (5.00%) low mild
  4 (4.00%) high mild
  10 (10.00%) high severe

string msg              time:   [485.43 ns 494.67 ns 506.65 ns]
                        change: [+3.6019% +6.4550% +9.5201%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 19 outliers among 100 measurements (19.00%)
  2 (2.00%) high mild
  17 (17.00%) high severe

string msg without encapsulation
                        time:   [482.87 ns 483.84 ns 484.97 ns]
                        change: [+2.1543% +4.6294% +6.9247%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 18 outliers among 100 measurements (18.00%)
  5 (5.00%) high mild
  13 (13.00%) high severe

string msg bincode      time:   [314.16 ns 315.70 ns 318.05 ns]
                        change: [-5.6984% -3.4561% -1.2635%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 15 outliers among 100 measurements (15.00%)
  1 (1.00%) high mild
  14 (14.00%) high severe

@danieleades danieleades marked this pull request as draft June 30, 2023 00:13
@danieleades
Copy link
Contributor Author

i have to assume that the difference in the benchmarks is due to the fact that my approach is runtime-polymorphic, whereas the current approach is compile-time polymorphic. I guess this can be closed?

@hrektts
Copy link
Owner

hrektts commented Jul 2, 2023

Reducing the amount of code is important, but I would prefer to focus on performance. This policy is also consistent with changes made in the past to improve performance (#2, #6).
I will close this for now, but feel free to reopen it if you have any suggestions for improvement.

@hrektts hrektts closed this Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants