Anki/rslib/src/storage
Damien Elmes 37151213cd Move more of the graph processing into the backend
The existing architecture serializes all cards and revlog entries in
the search range into a protobuf message, which the web frontend needs
to decode and then process. The thinking at the time was that this would
make it easier for add-ons to add extra graphs, but in the ~2.5 years
since the new graphs were introduced, no add-ons appear to have taken
advantage of it.

The cards and revlog entries can grow quite large on large collections -
on a collection I tested with approximately 2.5M reviews, the serialized
data is about 110MB, which is a lot to have to deserialize in JavaScript.

This commit shifts the preliminary processing of the data to the Rust end,
which means the data is able to be processed faster, and less needs to
be sent to the frontend. On the test collection above, this reduces the
serialized data from about 110MB to about 160KB, resulting in a more
than 2x performance improvement, and reducing frontend memory usage from
about 400MB to about 40MB.

This also makes #2043 more feasible - while it is still about 50-100%
slower than protobufjs, with the much smaller message size, the difference
is only about 10ms.
2022-12-16 21:42:17 +10:00
..
card Minor Rust cleanups (#2272) 2022-12-16 21:40:27 +10:00
config update to latest rusqlite 2021-06-25 16:22:21 +10:00
deck Minor Rust cleanups (#2272) 2022-12-16 21:40:27 +10:00
deckconfig Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
graves Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
note Minor Rust cleanups (#2272) 2022-12-16 21:40:27 +10:00
notetype Minor Rust cleanups (#2272) 2022-12-16 21:40:27 +10:00
revlog Move more of the graph processing into the backend 2022-12-16 21:42:17 +10:00
tag add basic tag completion to backend 2021-09-09 15:38:08 +02:00
upgrades Minor Rust cleanups (#2272) 2022-12-16 21:40:27 +10:00
collection_timestamps.rs update to latest rusqlite 2021-06-25 16:22:21 +10:00
mod.rs Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
schema11.sql Add comment explaining why sfld column has type integer 2021-01-25 18:39:59 +08:00
sqlite.rs Update Chrono Crate (#2242) 2022-12-07 17:00:14 +10:00
sync.rs Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
sync_check.rs zero out graves before comparison, instead of at creation 2021-06-30 10:08:52 +10:00