Robbepop / string-interner

A data structure to efficiently intern, cache and restore strings.
Other
175 stars 30 forks source link

Implement new Send + Sync bucket backend #29

Closed Robbepop closed 4 years ago

Robbepop commented 4 years ago

This is just an experiment.

Benchmarks

Below are some benchmarks between the current BucketBackend and the new BucketBackend2: The observation is that BucketBackend2 is slower for all benchmarks, especially for resolve and operations that depend on it (iteration). Also it can no longer profit from the &'static str optimizations.

get_or_intern/fill-empty/new/BucketBackend                                                                            
                        time:   [5.0048 ms 5.0314 ms 5.0615 ms]
                        thrpt:  [19.757 Melem/s 19.875 Melem/s 19.981 Melem/s]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe
get_or_intern/fill-empty/new/BucketBackend2                                                                            
                        time:   [5.6928 ms 5.7442 ms 5.8009 ms]
                        thrpt:  [17.239 Melem/s 17.409 Melem/s 17.566 Melem/s]
Found 10 outliers among 100 measurements (10.00%)
  6 (6.00%) high mild
  4 (4.00%) high severe

get_or_intern/fill-empty/with_capacity/BucketBackend                                                                             
                        time:   [3.1060 ms 3.1230 ms 3.1450 ms]
                        thrpt:  [31.796 Melem/s 32.021 Melem/s 32.196 Melem/s]
Found 6 outliers among 100 measurements (6.00%)
  5 (5.00%) high mild
  1 (1.00%) high severe
get_or_intern/fill-empty/with_capacity/BucketBackend2                                                                             
                        time:   [3.4833 ms 3.5022 ms 3.5231 ms]
                        thrpt:  [28.384 Melem/s 28.553 Melem/s 28.708 Melem/s]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe

get_or_intern/already-filled/BucketBackend                                                                             
                        time:   [2.1022 ms 2.1103 ms 2.1187 ms]
                        thrpt:  [47.199 Melem/s 47.387 Melem/s 47.569 Melem/s]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high mild
get_or_intern/already-filled/BucketBackend2                                                                            
                        time:   [2.4757 ms 2.4851 ms 2.4950 ms]
                        thrpt:  [40.080 Melem/s 40.239 Melem/s 40.393 Melem/s]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild

get_or_intern_static/BucketBackend/get_or_intern                                                                             
                        time:   [2.5550 us 2.5767 us 2.6074 us]
                        thrpt:  [19.943 Melem/s 20.181 Melem/s 20.353 Melem/s]
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) high mild
  9 (9.00%) high severe
get_or_intern_static/BucketBackend/get_or_intern_static                                                                             
                        time:   [1.8322 us 1.8396 us 1.8476 us]
                        thrpt:  [28.145 Melem/s 28.266 Melem/s 28.382 Melem/s]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe
get_or_intern_static/BucketBackend2/get_or_intern                                                                             
                        time:   [2.8893 us 2.9084 us 2.9328 us]
                        thrpt:  [17.731 Melem/s 17.879 Melem/s 17.997 Melem/s]
Found 15 outliers among 100 measurements (15.00%)
  3 (3.00%) high mild
  12 (12.00%) high severe
get_or_intern_static/BucketBackend2/get_or_intern_static                                                                             
                        time:   [2.8764 us 2.8869 us 2.8996 us]
                        thrpt:  [17.934 Melem/s 18.013 Melem/s 18.078 Melem/s]
Found 12 outliers among 100 measurements (12.00%)
  1 (1.00%) high mild
  11 (11.00%) high severe

resolve/already-filled/BucketBackend                                                                             
                        time:   [135.34 us 136.42 us 137.55 us]
                        thrpt:  [727.00 Melem/s 733.02 Melem/s 738.89 Melem/s]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
resolve/already-filled/BucketBackend2                                                                            
                        time:   [303.20 us 304.92 us 306.86 us]
                        thrpt:  [325.89 Melem/s 327.95 Melem/s 329.82 Melem/s]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe

get/already-filled/BucketBackend                                                                             
                        time:   [1.7385 ms 1.7478 ms 1.7587 ms]
                        thrpt:  [56.859 Melem/s 57.213 Melem/s 57.520 Melem/s]
Found 10 outliers among 100 measurements (10.00%)
  8 (8.00%) high mild
  2 (2.00%) high severe
get/already-filled/BucketBackend2                                                                             
                        time:   [2.1611 ms 2.1693 ms 2.1780 ms]
                        thrpt:  [45.913 Melem/s 46.099 Melem/s 46.273 Melem/s]
Found 7 outliers among 100 measurements (7.00%)
  6 (6.00%) high mild
  1 (1.00%) high severe

iter/already-filled/BucketBackend                                                                             
                        time:   [158.70 us 159.73 us 160.83 us]
                        thrpt:  [621.77 Melem/s 626.05 Melem/s 630.13 Melem/s]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high mild
iter/already-filled/BucketBackend2                                                                             
                        time:   [281.18 us 283.10 us 285.18 us]
                        thrpt:  [350.65 Melem/s 353.23 Melem/s 355.64 Melem/s]
Found 5 outliers among 100 measurements (5.00%)
  3 (3.00%) high mild
  2 (2.00%) high severe
coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.6%) to 33.527% when pulling a9decd1efa013b39203b264761452907949306e5 on implement-send-sync-bucket-backend into a7708ec693e03d8e760e0f0e0063a3939338d5c7 on master.