rust-vmm / event-manager

Apache License 2.0
46 stars 32 forks source link

feat: Procedural overhaul #107

Open JonathanWoollett-Light opened 1 year ago

JonathanWoollett-Light commented 1 year ago

Overhauls the event manager to offer a simpler and more procedural interface (which is also more performant).

Benchmarks

The benchmarks cannot be re-created exactly but I've tried to make them as close as possible.

These illustrate a significant performance improvement in all but one benchmark where there is a small performance degredation.

process_basic           time:   [9.0058 µs 9.0125 µs 9.0212 µs]
                        change: [-33.323% -33.247% -33.170%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 28 outliers among 200 measurements (14.00%)
  6 (3.00%) high mild
  22 (11.00%) high severe

process_with_arc_mutex  time:   [11.243 µs 11.245 µs 11.248 µs]
                        change: [-15.655% -15.559% -15.479%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 21 outliers among 200 measurements (10.50%)
  6 (3.00%) high mild
  15 (7.50%) high severe

process_with_inner_mut  time:   [9.6837 µs 9.6857 µs 9.6878 µs]
                        change: [-24.836% -24.778% -24.735%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 20 outliers among 200 measurements (10.00%)
  8 (4.00%) high mild
  12 (6.00%) high severe

process_dynamic_dispatch
                        time:   [19.187 µs 19.192 µs 19.198 µs]
                        change: [+3.4918% +3.5866% +3.6852%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 23 outliers among 200 measurements (11.50%)
  8 (4.00%) high mild
  15 (7.50%) high severe

process_dispatch_few_events
                        time:   [506.93 ns 507.06 ns 507.23 ns]
                        change: [-27.610% -27.536% -27.456%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 21 outliers among 200 measurements (10.50%)
  8 (4.00%) high mild
  13 (6.50%) high severe

Requirements

Before submitting your PR, please make sure you addressed the following requirements: