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

fix!: avoid cloning the input/outputs + remove anymap2 #44

Merged
merged 9 commits into from
Nov 27, 2023

Conversation

aminya
Copy link
Collaborator

@aminya aminya commented Nov 27, 2023

This prevents cloning of the input/outputs and removes anymap2 in favour of the standard Arc<dyn Any + ...>>.

I was able to find this performance issue via profiling #43. The profiling shows that this reduced the time from 690 ms to 591 ms. As you see, the Hashbrown::clone method is gone now.

After optimizations:

image
image

Before optimizations:

image
image

Benchmarks

The benchmarks also show an 8.5% improvement

Running benches/compute_dag_bench.rs (target/release/deps/compute_dag_bench-0054d485c319d409)
compute dag time: [455.21 µs 456.03 µs 456.87 µs]
change: [-8.7821% -8.4917% -8.2036%] (p = 0.00 < 0.05)
Performance has improved.
Found 421 outliers among 4000 measurements (10.53%)
281 (7.03%) high mild
140 (3.50%) high severe

Based on benchmarks, this is 8.5% faster

```
     Running benches/compute_dag_bench.rs (target/release/deps/compute_dag_bench-0054d485c319d409)
compute dag             time:   [455.21 µs 456.03 µs 456.87 µs]
                        change: [-8.7821% -8.4917% -8.2036%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 421 outliers among 4000 measurements (10.53%)
  281 (7.03%) high mild
  140 (3.50%) high severe
```

Signed-off-by: Amin Yahyaabadi <[email protected]>
BREAKING this returns an Arc<T> instead of T in the get_result methods

Signed-off-by: Amin Yahyaabadi <[email protected]>
@genedna
Copy link
Member

genedna commented Nov 27, 2023

@aminya,

When I merged #43, some conflicts needed to be resolved.

@aminya
Copy link
Collaborator Author

aminya commented Nov 27, 2023

Thanks. Fixed the conflict!

@genedna genedna enabled auto-merge November 27, 2023 23:38
@genedna genedna added this pull request to the merge queue Nov 27, 2023
Merged via the queue into dagrs-dev:main with commit 8bbb037 Nov 27, 2023
@aminya aminya deleted the clone branch November 28, 2023 06:06
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