y-crdt / y-octo

CRDT implementation which is compatible with https://github.com/yjs/yjs
https://octobase.pro/
Other
208 stars 6 forks source link

refactor: simplify item left/right refs #24

Closed forehalo closed 1 year ago

forehalo commented 1 year ago

change item.{left/right} from Option<Node> to Somr<Item>

github-actions[bot] commented 1 year ago

Benchmark for Linux

Click to view benchmark | Test | Base | PR | % | | --- | --- | --- | --- | | codec/jwst decode var_int (32 bit) | 333.2±1.14µs | 333.5±1.29µs | +0.09% | | codec/jwst decode var_uint (32 bit) | 287.3±0.65µs | 287.5±0.94µs | **+0.07%** | | codec/jwst decode var_uint (64 bit) | 310.2±2.08µs | 309.5±1.52µs | -0.23% | | codec/jwst encode var_int (32 bit) | 409.9±1.33µs | 409.9±1.43µs | -0.00% | | codec/jwst encode var_uint (32 bit) | 270.7±1.59µs | 273.6±4.69µs | **+1.07%** | | codec/jwst encode var_uint (64 bit) | 271.4±1.53µs | 282.0±3.43µs | **+3.91%** | | codec/lib0 decode var_int (64 bit) | 268.5±0.47µs | 271.7±1.98µs | **+1.19%** | | codec/lib0 decode var_uint (32 bit) | 241.5±2.82µs | 242.1±2.95µs | +0.25% | | codec/lib0 decode var_uint (64 bit) | 233.9±1.66µs | 233.9±2.00µs | -0.00% | | codec/lib0 encode var_int (64 bit) | 390.2±0.95µs | 390.0±0.63µs | **-0.05%** | | codec/lib0 encode var_uint (32 bit) | 287.2±4.38µs | 287.5±3.57µs | +0.10% | | codec/lib0 encode var_uint (64 bit) | 347.2±3.65µs | 346.6±3.02µs | -0.17% | | ops/array/jwst/insert | 374.0±0.69µs | 262.7±0.48µs | **-29.76%** | | ops/array/jwst/insert range | 505.7±2.50µs | 384.7±0.43µs | **-23.93%** | | ops/array/jwst/remove | 263.3±0.31µs | 170.3±0.10µs | **-35.32%** | | ops/array/yrs/insert | 80.1±0.36µs | 81.9±0.41µs | **+2.25%** | | ops/array/yrs/insert range | 103.4±0.74µs | 105.7±1.02µs | **+2.22%** | | ops/array/yrs/remove | 93.0±0.08µs | 91.5±0.23µs | **-1.61%** | | ops/text/jwst/insert | 142.4±1.25µs | 136.9±0.24µs | **-3.86%** | | ops/text/jwst/remove | 3.3±0.01µs | 3.3±0.00µs | -0.00% | | ops/text/yrs/insert | 36.0±0.04µs | 36.6±0.03µs | **+1.67%** | | ops/text/yrs/remove | 2.4±0.04µs | 2.3±0.01µs | **-4.17%** | | update/parse with jwst/basic.bin | 65.9±0.16µs | 67.1±0.11µs | **+1.82%** | | update/parse with jwst/database.bin | 53.3±0.10µs | 54.3±0.10µs | **+1.88%** | | update/parse with jwst/large.bin | 4.9±0.05ms | 5.1±0.05ms | **+4.08%** | | update/parse with jwst/with-subdoc.bin | 6.2±0.01µs | 6.4±0.03µs | **+3.23%** | | update/parse with yrs/basic.bin | 42.6±0.06µs | 42.2±0.13µs | **-0.94%** | | update/parse with yrs/database.bin | 34.4±0.05µs | 33.9±0.08µs | **-1.45%** | | update/parse with yrs/large.bin | 3.2±0.03ms | 3.1±0.02ms | **-3.12%** | | update/parse with yrs/with-subdoc.bin | 5.4±0.01µs | 6.1±0.01µs | **+12.96%** |

Benchmark for Windows

Click to view benchmark | Test | Base | PR | % | | --- | --- | --- | --- | | codec/jwst decode var_int (32 bit) | 441.8±9.95µs | 433.2±10.28µs | -1.95% | | codec/jwst decode var_uint (32 bit) | 533.1±22.30µs | 527.0±18.63µs | -1.14% | | codec/jwst decode var_uint (64 bit) | 585.2±13.54µs | 581.6±15.00µs | -0.62% | | codec/jwst encode var_int (32 bit) | 561.7±11.16µs | 553.1±10.22µs | -1.53% | | codec/jwst encode var_uint (32 bit) | 366.6±9.13µs | 359.2±8.82µs | -2.02% | | codec/jwst encode var_uint (64 bit) | 365.7±7.70µs | 360.9±7.73µs | -1.31% | | codec/lib0 decode var_int (64 bit) | 352.3±8.29µs | 347.0±7.99µs | -1.50% | | codec/lib0 decode var_uint (32 bit) | 294.3±7.62µs | 293.0±8.53µs | -0.44% | | codec/lib0 decode var_uint (64 bit) | 294.4±7.90µs | 294.5±9.57µs | +0.03% | | codec/lib0 encode var_int (64 bit) | 724.3±16.11µs | 717.4±18.69µs | -0.95% | | codec/lib0 encode var_uint (32 bit) | 485.2±10.88µs | 479.1±8.64µs | -1.26% | | codec/lib0 encode var_uint (64 bit) | 468.4±9.56µs | 471.2±17.66µs | +0.60% | | ops/array/jwst/insert | 543.2±50.11µs | 356.9±8.57µs | **-34.30%** | | ops/array/jwst/insert range | 649.7±13.96µs | 502.4±11.82µs | **-22.67%** | | ops/array/jwst/remove | 316.8±4.94µs | 208.5±4.98µs | **-34.19%** | | ops/array/yrs/insert | 129.1±2.26µs | 134.2±2.51µs | **+3.95%** | | ops/array/yrs/insert range | 176.7±2.87µs | 178.6±3.61µs | +1.08% | | ops/array/yrs/remove | 189.6±4.75µs | 191.4±4.46µs | +0.95% | | ops/text/jwst/insert | 224.5±4.08µs | 211.2±5.40µs | **-5.92%** | | ops/text/jwst/remove | 4.5±0.10µs | 5.4±0.07µs | **+20.00%** | | ops/text/yrs/insert | 55.8±1.06µs | 57.5±1.23µs | **+3.05%** | | ops/text/yrs/remove | 4.4±0.11µs | 5.6±0.13µs | **+27.27%** | | update/parse with jwst/basic.bin | 121.5±2.98µs | 118.4±5.95µs | **-2.55%** | | update/parse with jwst/database.bin | 95.7±2.10µs | 93.6±3.20µs | **-2.19%** | | update/parse with jwst/large.bin | 5.6±0.30ms | 5.7±0.32ms | **+1.79%** | | update/parse with jwst/with-subdoc.bin | 19.0±0.36µs | 17.9±0.29µs | **-5.79%** | | update/parse with yrs/basic.bin | 80.5±2.03µs | 79.1±1.44µs | **-1.74%** | | update/parse with yrs/database.bin | 65.1±2.05µs | 61.8±2.28µs | **-5.07%** | | update/parse with yrs/large.bin | 3.9±0.14ms | 3.8±0.12ms | **-2.56%** | | update/parse with yrs/with-subdoc.bin | 13.0±0.29µs | 13.7±0.30µs | **+5.38%** |