From 3061a133db75328da255ee96b657d8a13ade4754 Mon Sep 17 00:00:00 2001 From: Aditya Mukhopadhyay Date: Tue, 27 Oct 2026 22:51:21 +0530 Subject: [PATCH] docs(perf): verify keyword pattern constants after #551 (#531) --- docs/BENCHMARKS.md | 2 +- docs/benchmarks/531-Cargo.lock | 1375 +++++++++++++++++++++ docs/benchmarks/531-envelope.json | 767 ++++++++++++ docs/benchmarks/531-environment-after.txt | 7 + docs/benchmarks/531-keyword-constants.md | 195 +++ docs/benchmarks/531-profile-summary.json | 40 + 6 files changed, 2385 insertions(+), 1 deletion(-) create mode 100644 docs/benchmarks/531-Cargo.lock create mode 100644 docs/benchmarks/531-envelope.json create mode 100644 docs/benchmarks/531-environment-after.txt create mode 100644 docs/benchmarks/531-keyword-constants.md create mode 100644 docs/benchmarks/531-profile-summary.json diff --git a/docs/BENCHMARKS.md b/docs/BENCHMARKS.md index 2b8115e2c5..8a6728f8d0 100644 --- a/docs/BENCHMARKS.md +++ b/docs/BENCHMARKS.md @@ -226,7 +226,7 @@ On the executor, before #544 (the executor's query path is gone since #551). `pe - **DICT lookup per row (26–35%).** `uuid_of` does a B+tree `get` for every row's entity id (#530). - **Bindings as `HashMap` (about 25%).** SipHash insert, lookup and drop per row; #473's columnar batches replace them. - **`net_asserted_facts` over committed facts that `live_facts` already resolved (about 10%)** (#532). -- **Keyword constants hashed to a UUID per fact (about 8% of the join)** (#531). +- **Keyword constants hashed to a UUID per fact (about 8% of the old join)** (#531). The streaming engine resolves pattern constants while planning; see the [post-#551 audit and profiles](benchmarks/531-keyword-constants.md). Expression keyword/ref equality retains a separate per-row conversion described there. - `attribute_value` reads the whole attribute instead of seeking AVET (#518). Fixed by the streaming engine's `Scan` (#544): see below. ### Streaming engine (#544) diff --git a/docs/benchmarks/531-Cargo.lock b/docs/benchmarks/531-Cargo.lock new file mode 100644 index 0000000000..5f6ac6851a --- /dev/null +++ b/docs/benchmarks/531-Cargo.lock @@ -0,0 +1,1375 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloca" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4" +dependencies = [ + "cc", +] + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "bit-set" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d87354e4229f54a44f7bf2435906a4656dba36026ab6eaca629a2c436a691c" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5727b15fa97d4f4fee0a3b7c3d550ed0269f54329207b86388de918604e31269" +dependencies = [ + "borsh", + "serde", +] + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" + +[[package]] +name = "borsh" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "553c5d846a6ba5150c65e3b1b8ec073bcf1abc20f9b7220de384a4443ea4e20a" +dependencies = [ + "borsh-derive", + "bytes", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cdfe656708a01f89b451a7d36466e6fe6c414de0aa18fc54f864f6f9ca9f56" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytemuck" +version = "1.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86e055fa6e3e40ad6187ba25b6855eeb635d5271f8e0f0e1e9a5826b8d75bea0" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "chacha20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" +dependencies = [ + "cfg-if", + "cpufeatures", + "rand_core", +] + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d" +dependencies = [ + "anstyle", + "clap_lex", +] + +[[package]] +name = "clap_lex" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486" + +[[package]] +name = "cobs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror", +] + +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + +[[package]] +name = "cpufeatures" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ba106e844045ddc02c20768ac4b0b7cb45f2cc2ecbd833ac9f5dacb183c2055" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "criterion" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3" +dependencies = [ + "alloca", + "anes", + "cast", + "ciborium", + "clap", + "criterion-plot", + "itertools", + "num-traits", + "oorandom", + "page_size", + "plotters", + "rayon", + "regex", + "serde", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-deque" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "either" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "equivalent" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "find-msvc-tools" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "rand_core", +] + +[[package]] +name = "half" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +dependencies = [ + "cfg-if", + "crunchy", + "zerocopy", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.191" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "minicov" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4869b6a491569605d66d3952bcdf03df789e5b536e5f0cf7758a7f08a55ae24d" +dependencies = [ + "cc", + "walkdir", +] + +[[package]] +name = "minigraf" +version = "2.0.5" +dependencies = [ + "anyhow", + "chrono", + "crc32fast", + "criterion", + "js-sys", + "pest", + "pest_derive", + "pest_meta", + "postcard", + "proptest", + "regex-lite", + "serde", + "serde_json", + "tempfile", + "uuid", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "web-sys", + "wide", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "oorandom" +version = "11.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" + +[[package]] +name = "page_size" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "pest" +version = "2.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8db75153506001cb36ed924f08cadc862eb3f8c4d0d534139f29074769d7660" +dependencies = [ + "memchr", + "pest_stack_guard", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20aa17e11fb35664b67d5214a0afac57a360d231b6ec53d6eba0700b27d933b4" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626ec5afccf44ccbfeb2b232316510bb55b4bf34d891afcb0fb07d2b17d7fe9d" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "pest_meta" +version = "2.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3f45b6caa65c1b08186832745159c2529994146340a7bf44168095469720f5d" +dependencies = [ + "pest", +] + +[[package]] +name = "pest_stack_guard" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97e6cd2217057fa86b6eaa512917e58089d875b957a31e35e7ab729977e0a5f2" +dependencies = [ + "psm", + "stacker", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "plotters" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" + +[[package]] +name = "plotters-svg" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "postcard" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "heapless", + "serde", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8530004ccb15eae51c7e40009fbe317f341f804db54dc033eec1c50be28cfa0" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags", + "chacha20", + "core_detect", + "num-traits", + "rand", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "psm" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" +dependencies = [ + "cc", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" +dependencies = [ + "getrandom", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_xorshift" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60aa6af80be32871323012e02e6e65f8a7cc7890931ae421d217ad8fe0df2ccf" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-lite" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "safe_arch" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42c6efa15875e6ecb39ca61fb0b0c1a40b84fac5a5ffe71eef7d1000c8eb3f5f" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "spin" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "stacker" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707f49d46706bacf8a2b00d51dace3f9de527c13eec3778f570c411f89e69967" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "windows-sys", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "tokio" +version = "1.54.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" +dependencies = [ + "pin-project-lite", +] + +[[package]] +name = "toml_datetime" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.17+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" +dependencies = [ + "winnow", +] + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "uuid" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" +dependencies = [ + "getrandom", + "js-sys", + "serde_core", + "sha1_smol", + "wasm-bindgen", +] + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cbab34de2d982e9b48e18d216d04c4a6f641066ff19ffb699980f591ee3610e" +dependencies = [ + "js-sys", + "tokio", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 3.0.9", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-bindgen-test" +version = "0.3.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae7499dfd45780a0a91d7ee6bb9ac51970a4479a41a89da443fdda5a39547d42" +dependencies = [ + "async-trait", + "cast", + "js-sys", + "libm", + "minicov", + "nu-ansi-term", + "num-traits", + "oorandom", + "serde", + "serde_json", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", + "wasm-bindgen-test-shared", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b84b5ac638bfb168196a1a461fcc8f46a294a18b1b6be52133b4e0db122cc9f" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "wasm-bindgen-test-shared" +version = "0.2.129" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f692aa943ccd88363733b77063f32cfed5bc6cbea8e6e8b251b302f881606fe" + +[[package]] +name = "web-sys" +version = "0.3.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88261b9deccee56594c11a3460c462c41f58d148598fe70ad77070126a68aba4" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wide" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d920ac99c3c8edce110cb8d07dbb324d6d026011dce85b1e9355b70f0adacc4f" +dependencies = [ + "bytemuck", + "safe_arch", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + +[[package]] +name = "zerocopy" +version = "0.8.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/docs/benchmarks/531-envelope.json b/docs/benchmarks/531-envelope.json new file mode 100644 index 0000000000..3c4a2830cb --- /dev/null +++ b/docs/benchmarks/531-envelope.json @@ -0,0 +1,767 @@ +{ + "budget_secs": 15, + "cap_secs": 300, + "fixture_version": 1, + "minigraf": "2.0.5", + "scales": [ + { + "build": { + "build_ms": 1232.560966, + "entities": 16666, + "facts": 100000, + "file_bytes": 10764288, + "hot_tx_half": 1253, + "peak_rss_kb": 190232, + "tx_half": 126 + }, + "checkpoint_10k_ms": 46.186055, + "checkpoint_1_fact": { + "p50_ms": 0.758793, + "p99_ms": 1.604543, + "runs": 20 + }, + "label": "100k", + "open_ms": 0.138469, + "peak_rss_kb": 19692, + "queries": [ + { + "max_ms": 0.0405, + "name": "point_entity", + "p50_ms": 0.01857, + "p99_ms": 0.033585, + "peak_rss_kb": 5356, + "query": "[:find ?a :where [:p8333 :age ?a]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.040735, + "name": "attribute_value", + "p50_ms": 0.018476, + "p99_ms": 0.039586, + "peak_rss_kb": 5312, + "query": "[:find ?e :where [?e :name \"p8333\"]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 29.870999, + "name": "attribute_scan", + "p50_ms": 12.629947, + "p99_ms": 14.461266, + "peak_rss_kb": 6664, + "query": "[:find ?e ?a :where [?e :age ?a]]", + "rows": 16666, + "runs": 200 + }, + { + "max_ms": 0.085016, + "name": "join_2", + "p50_ms": 0.038212, + "p99_ms": 0.06758800000000001, + "peak_rss_kb": 5416, + "query": "[:find ?n :where [:p8333 :follows ?f] [?f :name ?n]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.23542, + "name": "join_3_selective", + "p50_ms": 0.221847, + "p99_ms": 0.230036, + "peak_rss_kb": 5420, + "query": "[:find ?n :where [:p8333 :manager ?b] [?s :manager ?b] [?s :name ?n]]", + "rows": 10, + "runs": 200 + }, + { + "max_ms": 50.583858, + "name": "join_3_scan", + "p50_ms": 43.020344, + "p99_ms": 49.9003, + "peak_rss_kb": 15208, + "query": "[:find ?e ?n :where [?e :follows ?f] [?f :group 7] [?f :name ?n]]", + "rows": 167, + "runs": 200 + }, + { + "max_ms": 0.101423, + "name": "join_2_pseudo", + "p50_ms": 0.044846, + "p99_ms": 0.09081, + "peak_rss_kb": 5400, + "query": "[:find ?n ?t :valid-at :any-valid-time :where [:p8333 :follows ?f] [?f :name ?n] [?f :db/tx-count ?t]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 3.880811, + "name": "not_probe", + "p50_ms": 2.926414, + "p99_ms": 3.264748, + "peak_rss_kb": 6456, + "query": "[:find ?e :where [?e :group 7] (not [?e :age 7])]", + "rows": 148, + "runs": 200 + }, + { + "max_ms": 6.252874, + "name": "not_join_hash", + "p50_ms": 5.90742, + "p99_ms": 6.203720000000001, + "peak_rss_kb": 6540, + "query": "[:find ?e :where [?e :group 7] [?e :age ?a] (not-join [?a] [?f :group 17] [?f :age ?a] [(< ?a 50)])]", + "rows": 72, + "runs": 200 + }, + { + "max_ms": 14.236051, + "name": "or_2", + "p50_ms": 8.585797, + "p99_ms": 10.190614, + "peak_rss_kb": 6660, + "query": "[:find ?e :where [?e :group 7] [?e :age ?a] (or-join [?a] (and [?f :group 17] [?f :age ?a] [(< ?a 30)]) (and [?g :group 27] [?g :age ?a] [(> ?a 60)]))]", + "rows": 111, + "runs": 200 + }, + { + "max_ms": 1.275776, + "name": "recursive_ancestors", + "p50_ms": 1.161339, + "p99_ms": 1.255727, + "peak_rss_kb": 5568, + "query": "[:find ?b :where (boss :p16665 ?b)]", + "rows": 5, + "runs": 200 + }, + { + "max_ms": 214.85934, + "name": "recursive", + "p50_ms": 184.376839, + "p99_ms": 214.85934, + "peak_rss_kb": 43368, + "query": "[:find ?x ?b :where (boss ?x ?b)]", + "rows": 72219, + "runs": 81 + }, + { + "max_ms": 0.067211, + "name": "as_of", + "p50_ms": 0.019747, + "p99_ms": 0.045732, + "peak_rss_kb": 5272, + "query": "[:find ?a :as-of 126 :where [:p2083 :age ?a]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.765768, + "name": "as_of_ts", + "p50_ms": 0.6944199999999999, + "p99_ms": 0.7476670000000001, + "peak_rss_kb": 5344, + "query": "[:find ?a :as-of \"2026-10-27T16:45:15.126Z\" :where [:p2083 :age ?a]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 15.566687, + "name": "as_of_ts_scan", + "p50_ms": 8.167324, + "p99_ms": 8.361617, + "peak_rss_kb": 6244, + "query": "[:find ?e ?a :as-of \"2026-10-27T16:45:15.126Z\" :where [?e :age ?a]]", + "rows": 8400, + "runs": 200 + }, + { + "max_ms": 0.040652, + "name": "valid_at", + "p50_ms": 0.020781, + "p99_ms": 0.037815, + "peak_rss_kb": 5272, + "query": "[:find ?s :valid-at \"2021-06-01T00:00:00Z\" :where [:p8333 :status ?s]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.788981, + "name": "limit", + "p50_ms": 0.325447, + "p99_ms": 0.61124, + "peak_rss_kb": 5508, + "query": "[:find ?e ?a :where [?e :age ?a] :limit 10]", + "rows": 10, + "runs": 200 + }, + { + "max_ms": 31.385523999999997, + "name": "top_k", + "p50_ms": 23.165838, + "p99_ms": 26.616985, + "peak_rss_kb": 6564, + "query": "[:find ?e ?a :where [?e :age ?a] :order-by [?a :desc] :limit 10]", + "rows": 10, + "runs": 200 + }, + { + "max_ms": 54.62909, + "name": "count", + "p50_ms": 46.488721, + "p99_ms": 54.153766, + "peak_rss_kb": 6768, + "query": "[:find (count ?v) :where [?e ?a ?v]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 13.345212, + "name": "count_grouped", + "p50_ms": 6.197724, + "p99_ms": 6.413692999999999, + "peak_rss_kb": 6040, + "query": "[:find ?g (count ?e) :where [?e :group ?g]]", + "rows": 100, + "runs": 200 + }, + { + "max_ms": 43.946276, + "name": "window", + "p50_ms": 36.554127, + "p99_ms": 41.351668, + "peak_rss_kb": 15620, + "query": "[:find ?e (rank :over (:order-by ?a)) :where [?e :age ?a]]", + "rows": 16666, + "runs": 200 + }, + { + "max_ms": 0.358219, + "name": "hot_current", + "p50_ms": 0.307261, + "p99_ms": 0.35817, + "peak_rss_kb": 5312, + "query": "[:find ?v :where [:hot :counter ?v]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.388721, + "name": "hot_as_of", + "p50_ms": 0.30123599999999995, + "p99_ms": 0.376511, + "peak_rss_kb": 5308, + "query": "[:find ?v :as-of 1253 :valid-at :any-valid-time :where [:hot :counter ?v]]", + "rows": 1, + "runs": 200 + } + ], + "rss_after_open_kb": 3008 + }, + { + "build": { + "build_ms": 11438.818532, + "entities": 166666, + "facts": 1000000, + "file_bytes": 126275584, + "hot_tx_half": 3503, + "peak_rss_kb": 447772, + "tx_half": 1251 + }, + "checkpoint_10k_ms": 108.848614, + "checkpoint_1_fact": { + "p50_ms": 0.902482, + "p99_ms": 1.666196, + "runs": 20 + }, + "label": "1m", + "open_ms": 0.201549, + "peak_rss_kb": 20988, + "queries": [ + { + "max_ms": 0.040059, + "name": "point_entity", + "p50_ms": 0.018229, + "p99_ms": 0.033463, + "peak_rss_kb": 5252, + "query": "[:find ?a :where [:p83333 :age ?a]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.041222, + "name": "attribute_value", + "p50_ms": 0.017455000000000002, + "p99_ms": 0.033732000000000005, + "peak_rss_kb": 5040, + "query": "[:find ?e :where [?e :name \"p83333\"]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 186.17616, + "name": "attribute_scan", + "p50_ms": 134.23138500000002, + "p99_ms": 147.59619199999997, + "peak_rss_kb": 7384, + "query": "[:find ?e ?a :where [?e :age ?a]]", + "rows": 166666, + "runs": 111 + }, + { + "max_ms": 0.088919, + "name": "join_2", + "p50_ms": 0.039144000000000005, + "p99_ms": 0.06128599999999999, + "peak_rss_kb": 5280, + "query": "[:find ?n :where [:p83333 :follows ?f] [?f :name ?n]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.237646, + "name": "join_3_selective", + "p50_ms": 0.207256, + "p99_ms": 0.232138, + "peak_rss_kb": 5208, + "query": "[:find ?n :where [:p83333 :manager ?b] [?s :manager ?b] [?s :name ?n]]", + "rows": 10, + "runs": 200 + }, + { + "max_ms": 1176.507335, + "name": "join_3_scan", + "p50_ms": 1158.606786, + "p99_ms": 1176.507335, + "peak_rss_kb": 46556, + "query": "[:find ?e ?n :where [?e :follows ?f] [?f :group 7] [?f :name ?n]]", + "rows": 1667, + "runs": 13 + }, + { + "max_ms": 0.066953, + "name": "join_2_pseudo", + "p50_ms": 0.044741, + "p99_ms": 0.062649, + "peak_rss_kb": 5392, + "query": "[:find ?n ?t :valid-at :any-valid-time :where [:p83333 :follows ?f] [?f :name ?n] [?f :db/tx-count ?t]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 37.258345, + "name": "not_probe", + "p50_ms": 27.870807, + "p99_ms": 30.840031, + "peak_rss_kb": 7076, + "query": "[:find ?e :where [?e :group 7] (not [?e :age 7])]", + "rows": 1481, + "runs": 200 + }, + { + "max_ms": 107.742961, + "name": "not_join_hash", + "p50_ms": 54.146928, + "p99_ms": 62.00409, + "peak_rss_kb": 7964, + "query": "[:find ?e :where [?e :group 7] [?e :age ?a] (not-join [?a] [?f :group 17] [?f :age ?a] [(< ?a 50)])]", + "rows": 740, + "runs": 200 + }, + { + "max_ms": 90.445313, + "name": "or_2", + "p50_ms": 82.14993399999999, + "p99_ms": 90.155753, + "peak_rss_kb": 8012, + "query": "[:find ?e :where [?e :group 7] [?e :age ?a] (or-join [?a] (and [?f :group 17] [?f :age ?a] [(< ?a 30)]) (and [?g :group 27] [?g :age ?a] [(> ?a 60)]))]", + "rows": 1112, + "runs": 182 + }, + { + "max_ms": 1.521216, + "name": "recursive_ancestors", + "p50_ms": 1.435499, + "p99_ms": 1.515934, + "peak_rss_kb": 5580, + "query": "[:find ?b :where (boss :p166665 ?b)]", + "rows": 6, + "runs": 200 + }, + { + "max_ms": 2967.7843949999997, + "name": "recursive", + "p50_ms": 2878.692155, + "p99_ms": 2967.7843949999997, + "peak_rss_kb": 329768, + "query": "[:find ?x ?b :where (boss ?x ?b)]", + "rows": 888885, + "runs": 6 + }, + { + "max_ms": 0.035916, + "name": "as_of", + "p50_ms": 0.018471, + "p99_ms": 0.033345, + "peak_rss_kb": 4984, + "query": "[:find ?a :as-of 1251 :where [:p20833 :age ?a]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.955142, + "name": "as_of_ts", + "p50_ms": 0.8119190000000001, + "p99_ms": 0.881396, + "peak_rss_kb": 5200, + "query": "[:find ?a :as-of \"2026-10-27T16:46:17.693Z\" :where [:p20833 :age ?a]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 89.408941, + "name": "as_of_ts_scan", + "p50_ms": 79.691596, + "p99_ms": 88.491359, + "peak_rss_kb": 7428, + "query": "[:find ?e ?a :as-of \"2026-10-27T16:46:17.693Z\" :where [?e :age ?a]]", + "rows": 83400, + "runs": 187 + }, + { + "max_ms": 0.06651499999999999, + "name": "valid_at", + "p50_ms": 0.020387, + "p99_ms": 0.039665, + "peak_rss_kb": 5248, + "query": "[:find ?s :valid-at \"2021-06-01T00:00:00Z\" :where [:p83333 :status ?s]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.462698, + "name": "limit", + "p50_ms": 0.333467, + "p99_ms": 0.383037, + "peak_rss_kb": 5240, + "query": "[:find ?e ?a :where [?e :age ?a] :limit 10]", + "rows": 10, + "runs": 200 + }, + { + "max_ms": 287.79153, + "name": "top_k", + "p50_ms": 249.576861, + "p99_ms": 287.79153, + "peak_rss_kb": 6872, + "query": "[:find ?e ?a :where [?e :age ?a] :order-by [?a :desc] :limit 10]", + "rows": 10, + "runs": 60 + }, + { + "max_ms": 472.102853, + "name": "count", + "p50_ms": 458.958964, + "p99_ms": 472.102853, + "peak_rss_kb": 7000, + "query": "[:find (count ?v) :where [?e ?a ?v]]", + "rows": 1, + "runs": 33 + }, + { + "max_ms": 120.154237, + "name": "count_grouped", + "p50_ms": 63.909004, + "p99_ms": 71.958799, + "peak_rss_kb": 6976, + "query": "[:find ?g (count ?e) :where [?e :group ?g]]", + "rows": 100, + "runs": 200 + }, + { + "max_ms": 483.986168, + "name": "window", + "p50_ms": 474.59761, + "p99_ms": 483.986168, + "peak_rss_kb": 102080, + "query": "[:find ?e (rank :over (:order-by ?a)) :where [?e :age ?a]]", + "rows": 166666, + "runs": 32 + }, + { + "max_ms": 0.363676, + "name": "hot_current", + "p50_ms": 0.306861, + "p99_ms": 0.355905, + "peak_rss_kb": 5368, + "query": "[:find ?v :where [:hot :counter ?v]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.356003, + "name": "hot_as_of", + "p50_ms": 0.29605499999999996, + "p99_ms": 0.331667, + "peak_rss_kb": 5260, + "query": "[:find ?v :as-of 3503 :valid-at :any-valid-time :where [:hot :counter ?v]]", + "rows": 1, + "runs": 200 + } + ], + "rss_after_open_kb": 3012 + }, + { + "build": { + "build_ms": 543735.2347370001, + "entities": 1666666, + "facts": 10000000, + "file_bytes": 1260449792, + "hot_tx_half": 26003, + "peak_rss_kb": 454952, + "tx_half": 12501 + }, + "checkpoint_10k_ms": 322.901138, + "checkpoint_1_fact": { + "p50_ms": 2.03192, + "p99_ms": 2.293187, + "runs": 20 + }, + "label": "10m", + "open_ms": 0.149775, + "peak_rss_kb": 20984, + "queries": [ + { + "max_ms": 0.048770999999999995, + "name": "point_entity", + "p50_ms": 0.018501, + "p99_ms": 0.034292, + "peak_rss_kb": 5312, + "query": "[:find ?a :where [:p833333 :age ?a]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.047157, + "name": "attribute_value", + "p50_ms": 0.017356, + "p99_ms": 0.032186, + "peak_rss_kb": 4916, + "query": "[:find ?e :where [?e :name \"p833333\"]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 1387.937067, + "name": "attribute_scan", + "p50_ms": 1372.169005, + "p99_ms": 1387.937067, + "peak_rss_kb": 7608, + "query": "[:find ?e ?a :where [?e :age ?a]]", + "rows": 1666666, + "runs": 11 + }, + { + "max_ms": 0.059271, + "name": "join_2", + "p50_ms": 0.037427, + "p99_ms": 0.055447, + "peak_rss_kb": 5332, + "query": "[:find ?n :where [:p833333 :follows ?f] [?f :name ?n]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.24455499999999997, + "name": "join_3_selective", + "p50_ms": 0.198616, + "p99_ms": 0.237596, + "peak_rss_kb": 5388, + "query": "[:find ?n :where [:p833333 :manager ?b] [?s :manager ?b] [?s :name ?n]]", + "rows": 10, + "runs": 200 + }, + { + "max_ms": 13624.536369, + "name": "join_3_scan", + "p50_ms": 13601.212862, + "p99_ms": 13624.536369, + "peak_rss_kb": 64956, + "query": "[:find ?e ?n :where [?e :follows ?f] [?f :group 7] [?f :name ?n]]", + "rows": 16667, + "runs": 5 + }, + { + "max_ms": 0.08413599999999999, + "name": "join_2_pseudo", + "p50_ms": 0.044371, + "p99_ms": 0.07551999999999999, + "peak_rss_kb": 5168, + "query": "[:find ?n ?t :valid-at :any-valid-time :where [:p833333 :follows ?f] [?f :name ?n] [?f :db/tx-count ?t]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 345.880613, + "name": "not_probe", + "p50_ms": 288.469285, + "p99_ms": 345.880613, + "peak_rss_kb": 7176, + "query": "[:find ?e :where [?e :group 7] (not [?e :age 7])]", + "rows": 14815, + "runs": 52 + }, + { + "max_ms": 578.298319, + "name": "not_join_hash", + "p50_ms": 561.4375160000001, + "p99_ms": 578.298319, + "peak_rss_kb": 9428, + "query": "[:find ?e :where [?e :group 7] [?e :age ?a] (not-join [?a] [?f :group 17] [?f :age ?a] [(< ?a 50)])]", + "rows": 7407, + "runs": 27 + }, + { + "max_ms": 920.078616, + "name": "or_2", + "p50_ms": 853.660629, + "p99_ms": 920.078616, + "peak_rss_kb": 13540, + "query": "[:find ?e :where [?e :group 7] [?e :age ?a] (or-join [?a] (and [?f :group 17] [?f :age ?a] [(< ?a 30)]) (and [?g :group 27] [?g :age ?a] [(> ?a 60)]))]", + "rows": 11111, + "runs": 18 + }, + { + "max_ms": 2.0830979999999997, + "name": "recursive_ancestors", + "p50_ms": 1.92186, + "p99_ms": 2.048903, + "peak_rss_kb": 5712, + "query": "[:find ?b :where (boss :p1666665 ?b)]", + "rows": 7, + "runs": 200 + }, + { + "max_ms": 49647.539516, + "name": "recursive", + "p50_ms": 49137.779461, + "p99_ms": 49647.539516, + "peak_rss_kb": 2643720, + "query": "[:find ?x ?b :where (boss ?x ?b)]", + "rows": 10555551, + "runs": 5 + }, + { + "max_ms": 0.038984, + "name": "as_of", + "p50_ms": 0.018552000000000003, + "p99_ms": 0.025925, + "peak_rss_kb": 5272, + "query": "[:find ?a :as-of 12501 :where [:p208333 :age ?a]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 1.015726, + "name": "as_of_ts", + "p50_ms": 0.925826, + "p99_ms": 0.974484, + "peak_rss_kb": 5812, + "query": "[:find ?a :as-of \"2026-10-27T16:52:40.548Z\" :where [:p208333 :age ?a]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 829.774496, + "name": "as_of_ts_scan", + "p50_ms": 807.807492, + "p99_ms": 829.774496, + "peak_rss_kb": 7380, + "query": "[:find ?e ?a :as-of \"2026-10-27T16:52:40.548Z\" :where [?e :age ?a]]", + "rows": 833400, + "runs": 19 + }, + { + "max_ms": 0.056204, + "name": "valid_at", + "p50_ms": 0.02139, + "p99_ms": 0.052447, + "peak_rss_kb": 5244, + "query": "[:find ?s :valid-at \"2021-06-01T00:00:00Z\" :where [:p833333 :status ?s]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.458271, + "name": "limit", + "p50_ms": 0.334978, + "p99_ms": 0.400744, + "peak_rss_kb": 5420, + "query": "[:find ?e ?a :where [?e :age ?a] :limit 10]", + "rows": 10, + "runs": 200 + }, + { + "max_ms": 2628.8659540000003, + "name": "top_k", + "p50_ms": 2575.419328, + "p99_ms": 2628.8659540000003, + "peak_rss_kb": 6952, + "query": "[:find ?e ?a :where [?e :age ?a] :order-by [?a :desc] :limit 10]", + "rows": 10, + "runs": 6 + }, + { + "max_ms": 4728.024452, + "name": "count", + "p50_ms": 4646.078889, + "p99_ms": 4728.024452, + "peak_rss_kb": 6964, + "query": "[:find (count ?v) :where [?e ?a ?v]]", + "rows": 1, + "runs": 5 + }, + { + "max_ms": 684.384056, + "name": "count_grouped", + "p50_ms": 645.513822, + "p99_ms": 684.384056, + "peak_rss_kb": 7100, + "query": "[:find ?g (count ?e) :where [?e :group ?g]]", + "rows": 100, + "runs": 24 + }, + { + "max_ms": 6056.150127000001, + "name": "window", + "p50_ms": 5953.322352, + "p99_ms": 6056.150127000001, + "peak_rss_kb": 895256, + "query": "[:find ?e (rank :over (:order-by ?a)) :where [?e :age ?a]]", + "rows": 1666666, + "runs": 5 + }, + { + "max_ms": 0.380041, + "name": "hot_current", + "p50_ms": 0.32615500000000003, + "p99_ms": 0.377194, + "peak_rss_kb": 5316, + "query": "[:find ?v :where [:hot :counter ?v]]", + "rows": 1, + "runs": 200 + }, + { + "max_ms": 0.34764399999999995, + "name": "hot_as_of", + "p50_ms": 0.293642, + "p99_ms": 0.34347099999999997, + "peak_rss_kb": 5308, + "query": "[:find ?v :as-of 26003 :valid-at :any-valid-time :where [:hot :counter ?v]]", + "rows": 1, + "runs": 200 + } + ], + "rss_after_open_kb": 2852 + } + ] +} \ No newline at end of file diff --git a/docs/benchmarks/531-environment-after.txt b/docs/benchmarks/531-environment-after.txt new file mode 100644 index 0000000000..6c95dcf63e --- /dev/null +++ b/docs/benchmarks/531-environment-after.txt @@ -0,0 +1,7 @@ +2026-10-27T17:19:15Z +phase: post-run validation after scratch cleanup +rustc 1.99.1 (58cf8f9c3 2026-10-13) +cargo 1.99.1 (5f94df478 2026-08-27) +6.8.0-139-generic +schedutil +task scratch directory absent diff --git a/docs/benchmarks/531-keyword-constants.md b/docs/benchmarks/531-keyword-constants.md new file mode 100644 index 0000000000..7291955576 --- /dev/null +++ b/docs/benchmarks/531-keyword-constants.md @@ -0,0 +1,195 @@ +# Keyword pattern constants after the streaming engine (#531) + +Source audited: [`v3` at `c89d648f5`](https://github.com/project-minigraf/minigraf/tree/c89d648f5863db43ac6dfd394c78f0afe6ac6745/src/query) (2026-10-27). The original +`PatternMatcher::match_component` loop is absent from `src/` after #551. +Keyword entity and value constants in patterns resolve to UUIDs when their +operator plans are built. This supersedes #531's original per-candidate +pattern-constant hashing path; it does not eliminate all keyword hashing. + +## Source audit + +Line references below describe the measured revision, not later releases. + +| Call site | When conversion runs | +|---|---| +| `engine/plan.rs:1530,1549` (`entity_const`, `value_const`) | When building a pattern's entity/value terms. A keyword value constant stores both its spelling and resolved UUID. | +| `engine/mod.rs:220`; `datalog/magic_sets.rs:27,88` | While opening a rule query or rewriting its invocation arguments into magic seeds. | +| `engine/recursive.rs:233` | A constant rule-head entity is resolved at the first emitted row and cached in `konst` for that `heads()` body run. Each full/delta run can resolve it again; it is not a per-candidate-fact operation. | +| `engine/ids.rs:232` (`keyword_eid`) | Normalizing a stored keyword id to the entity it names. Entries are query-long only when both the keyword id and entity id are provisional (`ids.rs:236–237`). Otherwise `end_pull` clears them (line 76). Ordinary stream pulls call it after each pull; window output streams defer that call until stream end (`engine/mod.rs:275,368–373`). `release` clears both maps (`ids.rs:82`). | +| `engine/plan.rs:92` (`names`), called through `ValueConst::matches` | UUID constants compared with stored keyword values. Committed `KeyTest::Uuid` memoizes by keyword id (`scan.rs:161–167`); pending facts (`scan.rs:571`) and derived cells (`scan.rs:685`) can convert each candidate's keyword. These are data conversions, not hashing a fixed keyword pattern constant. | +| `datalog/executor.rs:630` (`expr_eq`) | Keyword/ref expression equality evaluates once per row and can rehash a keyword literal. This separate expression path remains; see the follow-up below. | +| `datalog/parser.rs:2158` | Parsing: compare entity terms while assigning pseudo-attribute sources. | +| `datalog/parser/statement.rs:454,472`; `datalog/executor.rs:238,274` | Entity conversion for transact/retract statements, not query fact matching. | +| Other calls in `matcher.rs`, `magic_sets.rs`, `executor.rs` | Tests only. `matcher.rs` retains `edn_to_entity_id` and `edn_to_value`; the module name alone does not imply the old matcher executes. | + +References are relative to `src/query/`. Plain queries enter +`DatalogExecutor::open_query` (`datalog/executor.rs:315`) and always use +`engine::plan`/`engine::open`. Rule queries enter `open_rule_query` (line 354), +use `plan_rules` (`engine/plan.rs:670`) and execute on the same engine. +`rule_plan` (line 782) translates body rule calls to patterns before planning +full/delta runs. No legacy evaluator matches rule-body facts. + +First scans (`engine/plan.rs:1060`) and later joins (line 1446) use the same +constant resolvers. `Builder::sub` (line 1303) plans both hashed and correlated +`not`/`not-join` bodies and `or`/`or-join` branches before reading their rows. +`anti.rs` and `union.rs` construct operators from those plans; scan rewinds retain +resolved DICT constants. Prepared queries substitute slots, then call the same +executor open/execute paths (`datalog/prepared.rs:129,141,159`), planning on each +execution rather than each row. Cursors pull the resulting engine stream. +Write-transaction reads use that executor too (`src/db.rs:1774–1788`), as does +`BrowserDb::execute` (`src/browser/mod.rs:136`). + +## Measurements + +**Date:** 2026-10-27. Idle benchmark server, Intel Xeon E5-2696 v4, +Linux 6.8.0-139-generic, Rust 1.99.1; `envelope` profile (opt-level 3), +`-C force-frame-pointers=yes`, CPU and memory bound to NUMA node 1. The compiler +used the whole host before timing. No build/test ran alongside the measurements; +queries used checkpointed files opened read-only, with warm caches. The CPU +frequency governor was observed as `schedutil`. A [post-run environment +readback](531-environment-after.txt) confirms the toolchain and governor after +scratch cleanup; it is not a during-run measurement. These are current absolute measurements, +not an A/B against the old executor's historical 8% profile. + +The [raw envelope](531-envelope.json) contains all 23 shapes at each scale, +including storage and RSS. All 69 records completed without `error` or +`capped_ms`, and each timed at least five runs. The JSON's `minigraf: 2.0.5` +comes from the unreleased branch's Cargo manifest; the measured code is the +`v3` revision above, not the published v2.0.5 release. + +| Scale | Shape | Rows | Runs | p50 (ms) | p99 (ms) | +|---|---|---:|---:|---:|---:| +| 100k | `attribute_scan` | 16,666 | 200 | 12.629947 | 14.461266 | +| 100k | `join_3_selective` | 10 | 200 | 0.221847 | 0.230036 | +| 100k | `join_3_scan` | 167 | 200 | 43.020344 | 49.900300 | +| 1m | `attribute_scan` | 166,666 | 111 | 134.231385 | 147.596192 | +| 1m | `join_3_selective` | 10 | 200 | 0.207256 | 0.232138 | +| 1m | `join_3_scan` | 1,667 | 13 | 1158.606786 | 1176.507335 | +| 10m | `attribute_scan` | 1,666,666 | 11 | 1372.169005 | 1387.937067 | +| 10m | `join_3_selective` | 10 | 200 | 0.198616 | 0.237596 | +| 10m | `join_3_scan` | 16,667 | 5 | 13601.212862 | 13624.536369 | + +The harness checks `join_3_selective` against its `siblings` formula (10 at +these scales). `join_3_scan` skips that expected-count assertion; independently +summing `((i * 7919 + 1) % E) % 100 == 7` over `0 <= i < E`, with +`E = floor(N / 6)`, gives 167 / 1,667 / 16,667, matching the output. The other +unchecked expected count is `as_of_ts_scan`, whose result depends on timestamp +sharing; the harness still checks that every timed run returns the first run's +count. With fewer than 100 runs its reported p99 is the sample maximum. + +### Profiles at 1M + +Captured separately with `perf record -e cycles:u -F 499 --call-graph fp`. +The [profile summary](531-profile-summary.json) records 21,850 selective samples +and 7,770 attribute-scan samples, with zero lost samples in both captures. +The fast selective shape repeats `__query` 200 times (each child times 200 +queries plus warmup); all 200 children returned 10 rows. The attribute profile +runs one `__query` child and returns 166,666 rows. + +Each child also calls `fixture_shapes`, which scans the fact log to resolve the +fixture's transaction time. That setup accounts for 77.09% of sampled cycles in +the selective capture. To separate it, classify `perf script` stacks containing +`fixture_shapes` as setup, then stacks containing `perf_envelope::drain` as +query draining, and the remainder as other; percentages sum the samples' cycle +periods, not just their counts. There are 4,385 selective and 7,679 attribute +query-drain samples (22.77% and 98.93% of capture cycles, respectively). + +The selective capture has 16 stacks containing `edn_to_entity_id`: seven below +parser `entity_term`/`walk_sources`, six below planner `term<..., entity_const>` +and three below `IdSpace::keyword_eid` while joining stored keyword values. +Together they account for about 0.37% of sampled query-drain cycles. The parser +and planner conversions run while opening each query, not per candidate fact; +the stored-keyword case uses the cache described above. The attribute capture +has no stack containing that helper. Neither contains an old matcher stack. + +This supports the source-audit conclusion: the old per-fact fixed-pattern-keyword +conversion is gone. Sampling alone does not prove an operation never executes, +and optimized/inlined functions can lose their own frames. System-libc leaf +symbols are unresolved for 42.68% of selective and 26.69% of attribute +query-drain cycles, so these profiles are not a complete hotspot breakdown. +No existing envelope shape has a keyword constant in value position: that +constant's resolution is verified by the source audit, not these profiles. +The expression-equality path below is not exercised by these two shapes. + +### Reproducing + +On an otherwise idle bench host, check out the measured revision, copy the +[dependency lockfile](531-Cargo.lock) to its root as `Cargo.lock`, and set +`run_dir` to a fresh scratch directory outside the checkout: + +```bash +mkdir -p "$run_dir" +export CARGO_TARGET_DIR="$run_dir/target" +export RUSTFLAGS='-Cforce-frame-pointers=yes' +cargo build --profile envelope --example perf_envelope --locked +numactl --cpunodebind=1 --membind=1 \ + "$CARGO_TARGET_DIR/envelope/examples/perf_envelope" \ + --scales 100k,1m,10m --budget-secs 15 --cap-secs 300 \ + --dir "$run_dir/fixtures" --json "$run_dir/envelope.json" +``` + +For the selective capture, write the following to `$run_dir/selective.sh`: + +```bash +set -eu +for run in $(seq 1 200); do + "$CARGO_TARGET_DIR/envelope/examples/perf_envelope" __query \ + "$run_dir/fixtures/fixture-v1-1m.graph" 4 15 300 +done +``` + +Then export `run_dir` for that child shell and record both shapes separately: + +```bash +export run_dir +perf record -e cycles:u -F 499 --call-graph fp -o "$run_dir/selective.data" -- \ + numactl --cpunodebind=1 --membind=1 sh "$run_dir/selective.sh" +perf record -e cycles:u -F 499 --call-graph fp -o "$run_dir/attribute.data" -- \ + numactl --cpunodebind=1 --membind=1 \ + "$CARGO_TARGET_DIR/envelope/examples/perf_envelope" __query \ + "$run_dir/fixtures/fixture-v1-1m.graph" 2 15 300 +perf report -i "$run_dir/selective.data" --stdio --header --children +perf script -i "$run_dir/selective.data" | c++filt -s rust +``` + +Indexes 4 and 2 select `join_3_selective` and `attribute_scan` in the measured +source. Repeat the reporting commands for `attribute.data`. Inspect JSON records +for errors/caps even if the harness exits zero. Remove scratch fixtures, builds +and captures after retaining the reports. The dependency lockfile SHA-256 is +`b03965119fd8ce5b5cf3ad3d37fb194ffeae24b6a862a0c85ae8fbcb6833ee77`. + +## Separate expression-equality follow-up (draft) + +A query such as: + +```datalog +[:find ?f :where [?f :name ?n] [(= ?f :p5)]] +``` + +compares a ref with the same keyword literal once per input row. +`engine/filter.rs:155–173` evaluates expressions per row, and +`datalog/executor.rs:627–634` clones and resolves the keyword for every +keyword/ref equality pair. This path was added by #744, independently of the +removed pattern matcher; it is also present on `main` in v2.0.11. + +Its performance impact is unmeasured. Expression evaluation also allocates a +binding `HashMap` per row, so the UUID computation is only one potential cost. +A follow-up should measure this shape before choosing a milestone or cache +design. Preserve equality/inequality semantics, both operand orders, dynamic +operands and prepared slots. This is performance-only; under the support policy +it does not warrant a v2.x backport. This draft has not been posted as an issue. + +## Deviations from the approved design + +None in scope: this is verification and documentation only, with no engine, +API, format, dependency or release change. The source archive omits the ignored +`Cargo.lock`; it is generated from the bench host's existing dependency cache +before the locked build and retained above. For sufficient selective samples, +the existing fast child mode is repeated 200 times rather than changing the +harness. No query implementation or benchmark source was changed. + +The pre-run toolchain/governor were observed in command output; the standalone +environment artifact was captured only after the run. Post-run load artifacts +retained `uptime`, not the full active-CPU-process list requested by the plan. +The initial CPU-process list and intervening progress checks showed no competing +heavy workload, but the retained post-run load artifacts alone cannot prove that. diff --git a/docs/benchmarks/531-profile-summary.json b/docs/benchmarks/531-profile-summary.json new file mode 100644 index 0000000000..1c881c369e --- /dev/null +++ b/docs/benchmarks/531-profile-summary.json @@ -0,0 +1,40 @@ +{ + "selective": { + "samples": 21850, + "lost_samples": 0, + "sample_counts": { + "fixture_setup": 17388, + "other": 77, + "query_drain": 4385 + }, + "weighted_cycle_percent": { + "fixture_setup": 77.09107573804238, + "other": 0.13857810535030674, + "query_drain": 22.770346156607314 + }, + "edn_to_entity_id_stack_samples": { + "stored_keyword_id": 3, + "parser": 7, + "planner": 6 + }, + "edn_to_entity_id_percent_of_query_drain_cycles": 0.3714597811368226, + "unresolved_libc_leaf_percent_of_query_drain_cycles": 42.68441505741583 + }, + "attribute": { + "samples": 7770, + "lost_samples": 0, + "sample_counts": { + "fixture_setup": 83, + "query_drain": 7679, + "other": 8 + }, + "weighted_cycle_percent": { + "fixture_setup": 0.9616148432553183, + "query_drain": 98.93452314482762, + "other": 0.1038620119170567 + }, + "edn_to_entity_id_stack_samples": {}, + "edn_to_entity_id_percent_of_query_drain_cycles": 0.0, + "unresolved_libc_leaf_percent_of_query_drain_cycles": 26.693011175549167 + } +}