anki/Cargo.toml
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

52 lines
1.3 KiB
TOML

[workspace.package]
version = "0.0.0"
authors = ["Ankitects Pty Ltd and contributors <https://help.ankiweb.net>"]
license = "AGPL-3.0-or-later"
rust-version = "1.65"
edition = "2021"
[workspace]
members = [
"rslib",
"rslib/i18n",
"rslib/i18n_helpers",
"rslib/linkchecker",
"pylib/rsbridge",
"build/configure",
"build/ninja_gen",
"build/archives",
"build/runner",
"ftl",
"tools/workspace-hack",
"qt/bundle/win",
"qt/bundle/mac",
]
exclude = ["qt/bundle"]
resolver = "2"
[patch.crates-io]
# If updating rev, hakari.toml needs updating too.
reqwest = { git = "https://github.com/ankitects/reqwest.git", rev = "7591444614de02b658ddab125efba7b2bb4e2335" }
# Apply mild optimizations to our dependencies in dev mode, which among other things
# improves sha2 performance by about 21x. Opt 1 chosen due to
# https://doc.rust-lang.org/cargo/reference/profiles.html#overrides-and-generics. This
# applies to the dependencies of unit tests as well.
[profile.dev.package."*"]
opt-level = 1
debug = 0
[profile.dev.package.anki_i18n]
opt-level = 1
debug = 0
[profile.dev.package.runner]
opt-level = 1
# Debug info off by default, which speeds up incremental builds and produces a considerably
# smaller library.
[profile.dev.package.anki]
debug = 0
[profile.dev.package.rsbridge]
debug = 0