mirror of
https://github.com/storytold/AniCraft.git
synced 2026-11-21 18:12:28 +01:00
Measured (release, 120 s 48 kHz stereo): decode WAV 129 ms, Ogg 147 ms, MP3 99 ms; export_audio 95 ms at 48 kHz, 128 ms resampled to 44.1 kHz (about 1000x real time).
3.1 KiB
3.1 KiB
Development
Build, run, test
cargo build # app + CLI (debug)
cargo run # desktop app with the sample
cargo run -- --screenshot shots/now.png # draw ~120 frames, save the window, exit
cargo run -- --open <panel> --screenshot x.png # palette|shortcuts|files|confirm|transform|points|pen|frames|span|bucket|sound|tlzoom|tlwide|prefs|licenses|zoom
cargo test # every crate
cargo clippy --all-targets -- -D warnings
cargo deny check licenses bans sources
cargo run --release -p anicraft-cli -- bench # performance probe
Fonts: builds embed Inter and JetBrains Mono when CRAFT_FONTS_DIR points at a craft-fonts
checkout, or when one is found next to the repository (ADR 0005). Otherwise they use the
built-in fallback fonts.
Sound output (ADR 0014) uses cpal, which on Linux and the BSDs builds against ALSA: install
libasound2-dev and pkg-config (Debian/Ubuntu), alsa-lib-devel (Fedora) or alsa-lib
(Arch, FreeBSD). cargo build --no-default-features leaves sound output out (playback is
silent; import, waveforms and audio export still work). Tests never open an audio device.
Build footprint (biased for disk space, then time)
Measured on Windows, 32 threads, offline, from an empty target directory:
| Before (2026-10-28) | Now | |
|---|---|---|
| Debug build of the workspace | 6.5–6.9 GB in target/ (3.0 GB of it the incremental cache) |
1.04 GB (1.08 GB with all test binaries; 1.33 GB with build + tests + clippy, measured after a clean) |
| Fresh build time | ~60 s | 44 s (tests then add 3 s) |
| Rebuild after editing a UI file | ~2 s (incremental) | 3.8 s |
| Rebuild after editing an engine file | ~3 s | 6.0 s |
Debug anicraft.exe |
21 MB + 200 MB PDB | 21 MB + small line-table PDB |
What does it (in Cargo.toml):
| Setting | Effect |
|---|---|
profile.dev.debug = "line-tables-only" |
Panics and backtraces keep file:line; full variable info (most of the PDB/DWARF size) is gone. Also avoids MSVC's PDB limit (LNK1140). Use debug = true locally when you need a debugger session. |
profile.dev.incremental = false |
The incremental cache was ~3 GB for our crates. They rebuild from scratch in seconds. |
profile.dev.package."*": opt-level = 2, debug = false |
Dependencies are optimized once (a fast app even in debug) and carry no debug info. |
profile.dev.build-override: opt-level = 0, debug = false |
Build scripts and proc-macros compile fast and small. |
profile.release.strip = "debuginfo" |
Smaller release binaries. |
| eframe without default features | Drops links (url/idna/ICU Unicode tables) and the web-only screen-reader shim. |
House rules:
- One target directory. Never point agents or scripts at a second
CARGO_TARGET_DIR: each copy is another full build (1+ GB now, 3–7 GB before). - After changing profiles or dependency features, run
cargo cleanonce, so the old artifacts don't sit next to the new ones. Close the app first: Windows can't delete a running exe. - Clean up temporary measurement directories with
cargo clean --target-dir <dir>.