Analyze @tomic/lib vs atomic_lib duplication (and WASM tradeoffs) - #1278
Draft
joepio wants to merge 1 commit into
Draft
Analyze @tomic/lib vs atomic_lib duplication (and WASM tradeoffs)#1278joepio wants to merge 1 commit into
joepio wants to merge 1 commit into
Conversation
Map what @tomic/lib reimplements from atomic_lib, add reproducible benches, and recommend keeping the JS Resource cache while continuing to push node work (query/persist/apply) into WASM. Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Analysis request: how much logic is duplicated between
@tomic/libandatomic_lib/ WASM, and whether migrating the TS library onto WASM would help.Summary
There are two different overlaps, and they should not be treated as one problem:
Resource/Storeis a React cache + outbox + TipTapLoroDoc. RustResource/Dbis a durable node. Flutter already skipped the TS embedding and callsatomic_libdirectly.Recommendation: do not move
Resource.get/ the JS cache into WASM. Continue the existingAtomicNode/ClientDbdirection for query, persist, and apply-commit.Full write-up:
planning/ts-wasm-duplication.md.Measured costs (in-process; Worker would be slower)
Resource.get(name)getResource→ JSON-ADputResource(parse + index)WASM binaries already loaded by the browser:
atomic_wasm6.1 MB (2.3 MB gzip) +loro-crdt3.1 MB (1.0 MB gzip). TipTap needs a main-threadloro-crdtLoroDoc; folding Resource intoatomic_wasmdoes not remove that second heap.How to reproduce
Checklist
planning/ts-wasm-duplication.md+ README index