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

Actors were taking an excessive amount of memory upon creation. #260

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

slawlor
Copy link
Owner

@slawlor slawlor commented Sep 21, 2024

Some of this is unavoidable due to each actor having 3 bounded and 1 unbounded messaging channels, but the supervision logic alone had 3 dashmaps inside it. The monitoring functionality is pretty limited at-best, and we have no active use-cases for it, so dropping it and moving to a simple locked HashMap has allowed us to drop the heap space per actor to a little over 9KB

Additionally in running benchmarks against main we see large perf wins on actor creation time

     Running benches/actor.rs (target/release/deps/actor-464b0ad86c94b02f)
Gnuplot not found, using plotters backend
Creation of 100 actors  time:   [269.21 µs 282.84 µs 298.29 µs]
                        change: [-66.867% -64.514% -61.953%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 15 outliers among 100 measurements (15.00%)
  9 (9.00%) high mild
  6 (6.00%) high severe

Creation of 10000 actors
                        time:   [25.273 ms 25.862 ms 26.484 ms]
                        change: [-55.663% -53.735% -51.795%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

@slawlor slawlor force-pushed the memory_optimization branch from ec9bcf3 to fee2df8 Compare September 21, 2024 00:18
@slawlor slawlor marked this pull request as ready for review September 21, 2024 00:31
@slawlor slawlor force-pushed the memory_optimization branch 2 times, most recently from e8da372 to b78ad57 Compare September 21, 2024 01:04
…unbounded messaging channels, but the supervision logic alone had 3 dashmaps inside it. The monitoring functionality is pretty limited at-best, and we have no active use-cases for it, so dropping it and moving to a simple locked HashMap has allowed us to drop the heap space per actor to a little over 9KB

Additionally in running benchmarks against `main` we see large perf wins on actor creation time

```
     Running benches/actor.rs (target/release/deps/actor-464b0ad86c94b02f)
Gnuplot not found, using plotters backend
Creation of 100 actors  time:   [269.21 µs 282.84 µs 298.29 µs]
                        change: [-66.867% -64.514% -61.953%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 15 outliers among 100 measurements (15.00%)
  9 (9.00%) high mild
  6 (6.00%) high severe

Creation of 10000 actors
                        time:   [25.273 ms 25.862 ms 26.484 ms]
                        change: [-55.663% -53.735% -51.795%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
```
@slawlor slawlor force-pushed the memory_optimization branch from b78ad57 to b7f1126 Compare September 21, 2024 01:37
@slawlor slawlor merged commit 2c45fce into main Sep 21, 2024
12 checks passed
@slawlor slawlor deleted the memory_optimization branch September 21, 2024 01:48
@slawlor slawlor mentioned this pull request Sep 22, 2024
@slawlor slawlor mentioned this pull request Jan 8, 2025
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.

1 participant