toeverything / OctoBase

🐙 OctoBase is the open-source database behind AFFiNE, local-first, yet collaborative. A light-weight, scalable, data engine written in Rust.
https://octobase.dev
GNU Affero General Public License v3.0
1.41k stars 92 forks source link

refactor(codec): make store and type lock clean #520

Closed forehalo closed 1 year ago

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
octobase ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 23, 2023 8:29am
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 88.75% and no project coverage change.

Comparison is base (083a37a) 64.68% compared to head (7c2b67c) 64.68%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #520 +/- ## ======================================= Coverage 64.68% 64.68% ======================================= Files 184 184 Lines 21006 21004 -2 ======================================= - Hits 13587 13586 -1 + Misses 7419 7418 -1 ``` | [Files Changed](https://app.codecov.io/gh/toeverything/OctoBase/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything) | Coverage Δ | | |---|---|---| | [libs/jwst-codec/src/doc/types/map.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvdHlwZXMvbWFwLnJz) | `88.38% <79.16%> (-3.17%)` | :arrow_down: | | [libs/jwst-codec/src/doc/types/mod.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvdHlwZXMvbW9kLnJz) | `72.66% <86.00%> (+3.25%)` | :arrow_up: | | [libs/jwst-codec/src/doc/codec/content.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvY29kZWMvY29udGVudC5ycw==) | `85.08% <91.66%> (+0.78%)` | :arrow_up: | | [libs/jwst-codec/src/doc/codec/item.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvY29kZWMvaXRlbS5ycw==) | `71.19% <100.00%> (-0.10%)` | :arrow_down: | | [libs/jwst-codec/src/doc/codec/refs.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvY29kZWMvcmVmcy5ycw==) | `88.84% <100.00%> (+0.08%)` | :arrow_up: | | [libs/jwst-codec/src/doc/common/somr.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvY29tbW9uL3NvbXIucnM=) | `86.37% <100.00%> (+0.14%)` | :arrow_up: | | [libs/jwst-codec/src/doc/store.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2Mvc3RvcmUucnM=) | `88.24% <100.00%> (+0.09%)` | :arrow_up: | | [libs/jwst-codec/src/doc/types/list/mod.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvdHlwZXMvbGlzdC9tb2QucnM=) | `86.75% <100.00%> (+0.76%)` | :arrow_up: | | [...ibs/jwst-codec/src/doc/types/list/search\_marker.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/520?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvdHlwZXMvbGlzdC9zZWFyY2hfbWFya2VyLnJz) | `87.01% <100.00%> (ø)` | | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/toeverything/OctoBase/pull/520/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 year ago

Benchmark Results

Linux

group                                     master                                 pr
-----                                     ------                                 --
codec/jwst decode var_int (32 bit)        1.00    409.8±2.66µs        ? ?/sec    1.00    409.6±3.20µs        ? ?/sec
codec/jwst decode var_uint (32 bit)       1.00    280.5±0.10µs        ? ?/sec    1.00    280.5±0.12µs        ? ?/sec
codec/jwst decode var_uint (64 bit)       1.00    289.0±0.13µs        ? ?/sec    1.00    288.9±0.10µs        ? ?/sec
codec/jwst encode var_int (32 bit)        1.00    536.7±4.90µs        ? ?/sec    1.00    537.3±4.09µs        ? ?/sec
codec/jwst encode var_uint (32 bit)       1.00    318.9±1.22µs        ? ?/sec    1.00    318.7±0.80µs        ? ?/sec
codec/jwst encode var_uint (64 bit)       1.00    318.4±0.83µs        ? ?/sec    1.00    319.0±0.79µs        ? ?/sec
codec/lib0 decode var_int (64 bit)        1.00    295.8±0.17µs        ? ?/sec    1.00    295.9±1.02µs        ? ?/sec
codec/lib0 decode var_uint (32 bit)       1.00    418.3±0.20µs        ? ?/sec    1.00    418.3±0.13µs        ? ?/sec
codec/lib0 decode var_uint (64 bit)       1.00    385.0±0.15µs        ? ?/sec    1.00    385.0±0.12µs        ? ?/sec
codec/lib0 encode var_int (64 bit)        1.00    472.8±6.18µs        ? ?/sec    1.01    477.5±5.86µs        ? ?/sec
codec/lib0 encode var_uint (32 bit)       1.00    363.2±7.82µs        ? ?/sec    1.00    363.7±5.01µs        ? ?/sec
codec/lib0 encode var_uint (64 bit)       1.00    376.1±0.28µs        ? ?/sec    1.00    376.1±0.16µs        ? ?/sec
ops/array/jwst/insert                     1.00    378.5±2.14µs        ? ?/sec    1.00    379.0±2.51µs        ? ?/sec
ops/array/jwst/insert range               1.00    517.2±1.05µs        ? ?/sec    1.01    520.7±1.09µs        ? ?/sec
ops/array/jwst/remove                     1.00    257.4±0.23µs        ? ?/sec    1.00    256.4±0.23µs        ? ?/sec
ops/array/yrs/insert                      1.00     89.1±0.12µs        ? ?/sec    1.04     92.7±0.15µs        ? ?/sec
ops/array/yrs/insert range                1.00    114.2±0.30µs        ? ?/sec    1.00    114.0±0.07µs        ? ?/sec
ops/array/yrs/remove                      1.00     98.7±0.16µs        ? ?/sec    1.04    103.1±0.14µs        ? ?/sec
ops/text/jwst/insert                      1.00    151.9±0.30µs        ? ?/sec    1.04    157.3±0.38µs        ? ?/sec
ops/text/jwst/remove                      1.00      3.1±0.00µs        ? ?/sec    1.00      3.1±0.01µs        ? ?/sec
ops/text/yrs/insert                       1.00     44.3±0.10µs        ? ?/sec    1.00     44.4±0.06µs        ? ?/sec
ops/text/yrs/remove                       1.10      2.5±0.01µs        ? ?/sec    1.00      2.3±0.00µs        ? ?/sec
update/parse with jwst/basic.bin          1.00     67.8±0.10µs    80.6 MB/sec    1.00     67.8±0.09µs    80.6 MB/sec
update/parse with jwst/database.bin       1.01     54.7±0.06µs    60.6 MB/sec    1.00     54.4±0.10µs    61.0 MB/sec
update/parse with jwst/large.bin          1.00      3.6±0.00ms    64.1 MB/sec    1.00      3.5±0.01ms    64.4 MB/sec
update/parse with jwst/with-subdoc.bin    1.01      6.5±0.01µs   107.6 MB/sec    1.00      6.4±0.01µs   108.8 MB/sec
update/parse with yrs/basic.bin           1.00     44.6±0.03µs   122.3 MB/sec    1.00     44.5±0.09µs   122.8 MB/sec
update/parse with yrs/database.bin        1.01     36.1±0.08µs    91.7 MB/sec    1.00     35.9±0.05µs    92.3 MB/sec
update/parse with yrs/large.bin           1.00      2.2±0.01ms   102.7 MB/sec    1.00      2.2±0.01ms   102.3 MB/sec
update/parse with yrs/with-subdoc.bin     1.05      6.9±0.01µs   101.9 MB/sec    1.00      6.6±0.01µs   106.8 MB/sec

Windows

group                                     master                                 pr
-----                                     ------                                 --
codec/jwst decode var_int (32 bit)        1.00    365.2±4.32µs        ? ?/sec    1.00    365.1±5.05µs        ? ?/sec
codec/jwst decode var_uint (32 bit)       1.00    433.5±6.99µs        ? ?/sec    1.00    435.5±9.08µs        ? ?/sec
codec/jwst decode var_uint (64 bit)       1.00    324.3±4.51µs        ? ?/sec    1.00    323.3±4.17µs        ? ?/sec
codec/jwst encode var_int (32 bit)        1.00    497.4±6.85µs        ? ?/sec    1.00    497.4±5.92µs        ? ?/sec
codec/jwst encode var_uint (32 bit)       1.00    304.1±4.71µs        ? ?/sec    1.00    303.0±3.51µs        ? ?/sec
codec/jwst encode var_uint (64 bit)       1.00    303.1±4.18µs        ? ?/sec    1.00    303.7±4.27µs        ? ?/sec
codec/lib0 decode var_int (64 bit)        1.01    434.5±6.21µs        ? ?/sec    1.00    431.2±5.48µs        ? ?/sec
codec/lib0 decode var_uint (32 bit)       1.00    243.9±4.30µs        ? ?/sec    1.00    244.3±8.44µs        ? ?/sec
codec/lib0 decode var_uint (64 bit)       1.00    242.9±3.18µs        ? ?/sec    1.00    242.8±3.13µs        ? ?/sec
codec/lib0 encode var_int (64 bit)        1.01   606.1±10.22µs        ? ?/sec    1.00    600.7±7.93µs        ? ?/sec
codec/lib0 encode var_uint (32 bit)       1.01    401.7±6.07µs        ? ?/sec    1.00    399.3±5.64µs        ? ?/sec
codec/lib0 encode var_uint (64 bit)       1.00    414.4±7.20µs        ? ?/sec    1.00    412.7±7.58µs        ? ?/sec
ops/array/jwst/insert                     1.00    416.1±5.33µs        ? ?/sec    1.01    421.2±4.69µs        ? ?/sec
ops/array/jwst/insert range               1.00   555.0±35.83µs        ? ?/sec    1.01    560.7±5.49µs        ? ?/sec
ops/array/jwst/remove                     1.00    272.4±2.78µs        ? ?/sec    1.00    272.0±2.99µs        ? ?/sec
ops/array/yrs/insert                      1.00    107.7±1.43µs        ? ?/sec    1.00    107.5±1.50µs        ? ?/sec
ops/array/yrs/insert range                1.01    151.0±1.64µs        ? ?/sec    1.00    149.0±1.92µs        ? ?/sec
ops/array/yrs/remove                      1.00    155.7±1.79µs        ? ?/sec    1.01    158.0±3.01µs        ? ?/sec
ops/text/jwst/insert                      1.00    185.6±4.42µs        ? ?/sec    1.02    189.9±2.82µs        ? ?/sec
ops/text/jwst/remove                      1.00      4.4±0.05µs        ? ?/sec    1.10      4.9±0.05µs        ? ?/sec
ops/text/yrs/insert                       1.03     47.9±0.57µs        ? ?/sec    1.00     46.4±0.43µs        ? ?/sec
ops/text/yrs/remove                       1.21      4.7±0.07µs        ? ?/sec    1.00      3.9±0.04µs        ? ?/sec
update/parse with jwst/basic.bin          1.02     98.6±1.18µs    55.4 MB/sec    1.00     96.4±0.94µs    56.7 MB/sec
update/parse with jwst/database.bin       1.01     76.0±0.87µs    43.6 MB/sec    1.00     75.7±0.85µs    43.8 MB/sec
update/parse with jwst/large.bin          1.00      4.6±0.09ms    50.0 MB/sec    1.01      4.6±0.10ms    49.6 MB/sec
update/parse with jwst/with-subdoc.bin    1.04     14.9±0.15µs    47.0 MB/sec    1.00     14.3±0.16µs    48.9 MB/sec
update/parse with yrs/basic.bin           1.00     66.2±0.83µs    82.5 MB/sec    1.01     67.1±0.59µs    81.4 MB/sec
update/parse with yrs/database.bin        1.00     51.7±0.80µs    64.1 MB/sec    1.02     52.6±1.80µs    62.9 MB/sec
update/parse with yrs/large.bin           1.00      3.1±0.09ms    73.8 MB/sec    1.00      3.1±0.10ms    74.1 MB/sec
update/parse with yrs/with-subdoc.bin     1.09     11.6±0.13µs    60.1 MB/sec    1.00     10.7±0.09µs    65.4 MB/sec