Skip to content
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

encode performance tweaks #43

Merged
merged 2 commits into from
May 8, 2024
Merged

encode performance tweaks #43

merged 2 commits into from
May 8, 2024

Conversation

michaelkirk
Copy link
Member

@michaelkirk michaelkirk commented May 7, 2024

update: merged Depends on #44, so review that first.

Inspired by the work in #40, which had several different changes in it, with mixed results.

I've tried to extract only the strictly beneficial parts here.

$ cargo bench --bench="*" -- --baseline=main3
    Finished bench [optimized] target(s) in 0.03s
     Running benches/benchmarks.rs (target/release/deps/benchmarks-594cd3d509514e72)
encode 10_000 coordinates at precision 1e-5
                        time:   [108.92 µs 109.15 µs 109.42 µs]
                        change: [-14.204% -14.035% -13.852%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe

encode 10_000 coordinates at precision 1e-6
                        time:   [124.45 µs 125.23 µs 126.08 µs]
                        change: [-8.1045% -7.5507% -6.9785%] (p = 0.00 < 0.05)
                        Performance has improved.

#### NOTE: This is likely spurious — I only made changes to the `encode` code path.
decode 10_000 coordinates at precision 1e-5
                        time:   [89.408 µs 90.392 µs 91.407 µs]
                        change: [-4.8269% -3.8252% -2.8511%] (p = 0.00 < 0.05)
                        Performance has improved.

decode 10_000 coordinates at precision 1e-6
                        time:   [93.003 µs 93.917 µs 94.787 µs]
                        change: [-1.4427% -0.5576% +0.2285%] (p = 0.20 > 0.05)
                        No change in performance detected.

michaelkirk and others added 2 commits May 8, 2024 15:18
let mut previous = Coord { x: 0, y: 0 };

for (i, next) in coordinates.into_iter().enumerate() {
if !(MIN_LATITUDE..MAX_LATITUDE).contains(&next.y) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤌

@michaelkirk michaelkirk added this pull request to the merge queue May 8, 2024
Merged via the queue into main with commit 4cc9ff0 May 8, 2024
1 check passed
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