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.38k stars 91 forks source link

fix(codec): wrong decode logic for update with subdoc #497

Closed forehalo closed 1 year ago

forehalo commented 1 year ago

yjs encode/decode subdoc option as just Any, not Any[], see yjs

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 1, 2023 7:58am
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 83.33% and project coverage change: +0.01% :tada:

Comparison is base (f7bbc35) 68.40% compared to head (4b65d6e) 68.41%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #497 +/- ## ========================================== + Coverage 68.40% 68.41% +0.01% ========================================== Files 162 162 Lines 19362 19369 +7 ========================================== + Hits 13245 13252 +7 Misses 6117 6117 ``` | [Files Changed](https://app.codecov.io/gh/toeverything/OctoBase/pull/497?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/mod.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/497?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvdHlwZXMvbW9kLnJz) | `66.17% <0.00%> (-0.33%)` | :arrow_down: | | [libs/jwst-codec/src/doc/codec/content.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/497?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvY29kZWMvY29udGVudC5ycw==) | `84.82% <100.00%> (ø)` | | | [libs/jwst-codec/src/doc/codec/update.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/497?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvY29kZWMvdXBkYXRlLnJz) | `79.70% <100.00%> (+0.25%)` | :arrow_up: | | [libs/jwst-codec/src/doc/common/somr.rs](https://app.codecov.io/gh/toeverything/OctoBase/pull/497?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toeverything#diff-bGlicy9qd3N0LWNvZGVjL3NyYy9kb2MvY29tbW9uL3NvbXIucnM=) | `85.44% <100.00%> (+0.05%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/toeverything/OctoBase/pull/497/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.01   401.9±15.38µs        ? ?/sec    1.00   398.6±14.54µs        ? ?/sec
codec/jwst decode var_int (64 bit)        1.01   402.4±11.09µs        ? ?/sec    1.00   398.1±19.69µs        ? ?/sec
codec/jwst decode var_uint (32 bit)       1.00   353.0±12.03µs        ? ?/sec    1.00   352.3±12.65µs        ? ?/sec
codec/jwst decode var_uint (64 bit)       1.00   355.1±14.10µs        ? ?/sec    1.00   354.4±16.29µs        ? ?/sec
codec/jwst encode var_int (32 bit)        1.00   550.3±17.91µs        ? ?/sec    1.02   561.9±28.03µs        ? ?/sec
codec/jwst encode var_int (64 bit)        1.01   579.2±19.63µs        ? ?/sec    1.00   572.8±26.03µs        ? ?/sec
codec/jwst encode var_uint (32 bit)       1.01   347.5±13.68µs        ? ?/sec    1.00   345.5±14.65µs        ? ?/sec
codec/jwst encode var_uint (64 bit)       1.01   348.2±13.43µs        ? ?/sec    1.00   344.5±14.86µs        ? ?/sec
codec/lib0 decode var_int (64 bit)        1.00   357.3±13.49µs        ? ?/sec    1.00   358.1±16.04µs        ? ?/sec
codec/lib0 decode var_uint (32 bit)       1.00    309.0±9.63µs        ? ?/sec    1.00   307.8±11.02µs        ? ?/sec
codec/lib0 decode var_uint (64 bit)       1.02    310.6±9.38µs        ? ?/sec    1.00   304.3±14.65µs        ? ?/sec
codec/lib0 encode var_int (64 bit)        1.00   503.6±22.96µs        ? ?/sec    1.03   516.8±21.79µs        ? ?/sec
codec/lib0 encode var_uint (32 bit)       1.00   350.7±15.50µs        ? ?/sec    1.00   351.9±13.14µs        ? ?/sec
codec/lib0 encode var_uint (64 bit)       1.01   349.2±15.66µs        ? ?/sec    1.00   345.1±18.07µs        ? ?/sec
ops/array/jwst/insert                     1.02   454.2±16.96µs        ? ?/sec    1.00   445.9±19.16µs        ? ?/sec
ops/array/jwst/insert range               1.00   601.0±21.56µs        ? ?/sec    1.00   601.6±21.02µs        ? ?/sec
ops/array/jwst/remove                     1.00    306.4±7.88µs        ? ?/sec    1.00    305.2±9.52µs        ? ?/sec
ops/array/yrs/insert                      1.04    108.6±3.75µs        ? ?/sec    1.00    104.4±2.55µs        ? ?/sec
ops/array/yrs/insert range                1.05    142.3±5.11µs        ? ?/sec    1.00    135.7±4.61µs        ? ?/sec
ops/array/yrs/remove                      1.05    123.1±3.44µs        ? ?/sec    1.00    117.4±4.11µs        ? ?/sec
ops/text/jwst/insert                      1.00    183.1±7.68µs        ? ?/sec    1.00    183.1±6.04µs        ? ?/sec
ops/text/jwst/remove                      1.00      3.0±0.11µs        ? ?/sec    1.00      3.0±0.08µs        ? ?/sec
ops/text/yrs/insert                       1.00     50.9±1.58µs        ? ?/sec    1.00     50.7±1.33µs        ? ?/sec
ops/text/yrs/remove                       1.00      2.8±0.11µs        ? ?/sec    1.00      2.8±0.08µs        ? ?/sec
update/parse with jwst/basic.bin          1.04     71.6±2.57µs    76.3 MB/sec    1.00     68.6±1.94µs    79.6 MB/sec
update/parse with jwst/database.bin       1.06     71.5±3.02µs    46.4 MB/sec    1.00     67.3±2.54µs    49.2 MB/sec
update/parse with jwst/large.bin          1.03      4.6±0.13ms    49.8 MB/sec    1.00      4.5±0.15ms    51.1 MB/sec
update/parse with jwst/with-subdoc.bin                                           1.00      9.8±0.40µs    71.2 MB/sec
update/parse with yrs/basic.bin           1.00     56.6±1.92µs    96.5 MB/sec    1.00     56.5±1.74µs    96.6 MB/sec
update/parse with yrs/database.bin        1.01     45.2±1.58µs    73.3 MB/sec    1.00     44.6±1.68µs    74.2 MB/sec
update/parse with yrs/large.bin           1.02      2.8±0.08ms    80.2 MB/sec    1.00      2.8±0.11ms    81.9 MB/sec
update/parse with yrs/with-subdoc.bin                                            1.00      7.1±0.32µs    98.7 MB/sec

Windows

group                                     master                                 pr
-----                                     ------                                 --
codec/jwst decode var_int (32 bit)        1.00    436.9±5.45µs        ? ?/sec    1.00    437.0±5.24µs        ? ?/sec
codec/jwst decode var_int (64 bit)        1.00    404.9±5.74µs        ? ?/sec    1.00    405.0±5.44µs        ? ?/sec
codec/jwst decode var_uint (32 bit)       1.00    400.8±7.64µs        ? ?/sec    1.00    399.1±4.93µs        ? ?/sec
codec/jwst decode var_uint (64 bit)       1.00    484.2±5.76µs        ? ?/sec    1.00    484.2±5.79µs        ? ?/sec
codec/jwst encode var_int (32 bit)        1.00    464.4±7.43µs        ? ?/sec    1.01    468.5±7.91µs        ? ?/sec
codec/jwst encode var_int (64 bit)        1.00    474.2±7.36µs        ? ?/sec    1.01    479.5±7.66µs        ? ?/sec
codec/jwst encode var_uint (32 bit)       1.00    382.6±4.77µs        ? ?/sec    1.00    383.2±5.24µs        ? ?/sec
codec/jwst encode var_uint (64 bit)       1.00    383.1±4.63µs        ? ?/sec    1.00    383.1±5.16µs        ? ?/sec
codec/lib0 decode var_int (64 bit)        1.00    432.6±6.21µs        ? ?/sec    1.00    431.2±6.07µs        ? ?/sec
codec/lib0 decode var_uint (32 bit)       1.00    243.0±3.41µs        ? ?/sec    1.00    243.6±3.52µs        ? ?/sec
codec/lib0 decode var_uint (64 bit)       1.00    354.2±3.86µs        ? ?/sec    1.00    354.7±3.91µs        ? ?/sec
codec/lib0 encode var_int (64 bit)        1.01   607.0±14.85µs        ? ?/sec    1.00    601.7±9.26µs        ? ?/sec
codec/lib0 encode var_uint (32 bit)       1.00    398.3±6.04µs        ? ?/sec    1.00    398.6±5.92µs        ? ?/sec
codec/lib0 encode var_uint (64 bit)       1.00    387.4±5.90µs        ? ?/sec    1.00    386.5±4.33µs        ? ?/sec
ops/array/jwst/insert                     1.00    411.5±3.96µs        ? ?/sec    1.01    414.7±7.17µs        ? ?/sec
ops/array/jwst/insert range               1.00    549.3±5.86µs        ? ?/sec    1.01    554.8±6.65µs        ? ?/sec
ops/array/jwst/remove                     1.00    265.8±2.34µs        ? ?/sec    1.00    266.9±3.12µs        ? ?/sec
ops/array/yrs/insert                      1.00    106.7±0.99µs        ? ?/sec    1.02    108.7±1.31µs        ? ?/sec
ops/array/yrs/insert range                1.00    150.3±1.47µs        ? ?/sec    1.01    151.6±1.63µs        ? ?/sec
ops/array/yrs/remove                      1.01    158.8±1.48µs        ? ?/sec    1.00    157.6±2.21µs        ? ?/sec
ops/text/jwst/insert                      1.02    185.1±4.93µs        ? ?/sec    1.00    181.9±2.09µs        ? ?/sec
ops/text/jwst/remove                      1.04      3.0±0.04µs        ? ?/sec    1.00      2.9±0.03µs        ? ?/sec
ops/text/yrs/insert                       1.05     48.7±0.60µs        ? ?/sec    1.00     46.3±0.62µs        ? ?/sec
ops/text/yrs/remove                       1.29      4.7±0.05µs        ? ?/sec    1.00      3.7±0.03µs        ? ?/sec
update/parse with jwst/basic.bin          1.03     98.3±1.04µs    55.5 MB/sec    1.00     95.6±1.10µs    57.1 MB/sec
update/parse with jwst/database.bin       1.04     77.8±0.89µs    42.6 MB/sec    1.00     75.0±0.84µs    44.2 MB/sec
update/parse with jwst/large.bin          1.00      4.6±0.12ms    49.8 MB/sec    1.00      4.6±0.16ms    49.7 MB/sec
update/parse with jwst/with-subdoc.bin                                           1.00     14.2±0.12µs    49.2 MB/sec
update/parse with yrs/basic.bin           1.00     66.9±0.57µs    81.6 MB/sec    1.01     67.5±0.80µs    81.0 MB/sec
update/parse with yrs/database.bin        1.00     51.7±0.53µs    64.1 MB/sec    1.01     52.2±0.47µs    63.5 MB/sec
update/parse with yrs/large.bin           1.00      3.1±0.10ms    73.1 MB/sec    1.02      3.2±0.09ms    71.5 MB/sec
update/parse with yrs/with-subdoc.bin                                            1.00     11.6±0.14µs    60.4 MB/sec