diff --git a/README.md b/README.md index a17d421..ab3c9f1 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,10 @@ teardown, IR writes, Clang lowering and linking. See [the build benchmark tools](tools/benchmarks/README.md) for repeatable Redis/Git comparisons and interpretation of nested stage and Clang trace totals. +For record-member scaling and a separate Clang comparison to LLVM IR, see the +[2026-10-18 frontend measurements](tools/benchmarks/results/linux-x86_64-2026-10-18-record-members.md). +These measurements do not replace the clean-build timings below. + ## Measured Linux build times ### Native preprocessing and LLVM tools backend (2026-10-17) diff --git a/examples/profile_record_members.rs b/examples/profile_record_members.rs new file mode 100644 index 0000000..c7f67f0 --- /dev/null +++ b/examples/profile_record_members.rs @@ -0,0 +1,55 @@ +//! Measure tokenization, AST construction and teardown for record-heavy inputs. + +use dynamite_compiler::{ + ast::{AstBuilder, AstBuilderImpl}, + error::ErrorPrinter, + tokenizer::Tokenizer, +}; +use std::{hint::black_box, time::Instant}; + +fn frontend(code: &str) { + let logger = ErrorPrinter::new(code); + let tokens = Tokenizer::tokenize(code, false).unwrap(); + let mut builder = AstBuilderImpl::new(&logger, &tokens); + black_box(builder.build(false)); +} + +fn median_ms(code: &str, iterations: usize) -> f64 { + frontend(code); + let mut samples = Vec::with_capacity(9); + for _ in 0..9 { + let start = Instant::now(); + for _ in 0..iterations { + frontend(black_box(code)); + } + samples.push(start.elapsed().as_secs_f64() * 1_000.0 / iterations as f64); + } + samples.sort_by(f64::total_cmp); + samples[samples.len() / 2] +} + +fn main() { + println!("workload\ttokenize_parse_drop_ms"); + for members in [128, 512, 2048] { + let fields = (0..members) + .map(|index| format!("int field{index};")) + .collect::(); + let last = members - 1; + let code = format!( + "struct Wide {{{fields}}};int main(void){{struct Wide value;value.field{last}=7;return value.field{last};}}" + ); + println!("wide-{members}\t{:.4}", median_ms(&code, 5)); + } + let fields = (0..512) + .map(|index| format!("int field{index};")) + .collect::(); + let values = vec!["1"; 512].join(","); + let code = format!( + "struct Wide {{{fields}}};int main(void){{struct Wide value={{{values}}};return value.field511;}}" + ); + println!("initialized-512\t{:.4}", median_ms(&code, 5)); + for path in std::env::args().skip(1) { + let code = std::fs::read_to_string(&path).unwrap(); + println!("{path}\t{:.4}", median_ms(&code, 1)); + } +} diff --git a/src/ast/initializers.rs b/src/ast/initializers.rs index 259c577..37615b8 100644 --- a/src/ast/initializers.rs +++ b/src/ast/initializers.rs @@ -145,7 +145,9 @@ impl AstBuilderImpl<'_> { Some(child.as_ref().clone()) } Type::Struct(st) => st - .members() + .definition() + .borrow() + .members .get(index) .filter(|member| !matches!(member.ty.unqualified(), Type::Arr(_, None))) .map(|member| member.ty.clone()), @@ -447,7 +449,9 @@ impl AstBuilderImpl<'_> { .collect(), ), Type::Struct(ty) => Some( - ty.members() + ty.definition() + .borrow() + .members .iter() .filter(|member| !matches!(member.ty.unqualified(), Type::Arr(_, None))) .map(|member| Self::member_node(node.clone(), member, token)) @@ -505,7 +509,9 @@ impl AstBuilderImpl<'_> { vec![] } else { record - .members() + .definition() + .borrow() + .members .iter() .filter(|member| member.bit_field.is_none()) .map(|member| (member.offset, member.offset + member.ty.size_of())) diff --git a/src/ast/transparent_union.rs b/src/ast/transparent_union.rs index 0a4598a..d551b03 100644 --- a/src/ast/transparent_union.rs +++ b/src/ast/transparent_union.rs @@ -34,7 +34,9 @@ impl AstBuilderImpl<'_> { ); return; }; - let members = record.members(); + let definition = record.definition(); + let definition = definition.borrow(); + let members = &definition.members; let valid = record.definition().borrow().is_union && ty.is_complete_object() && members.first().is_some_and(|first| { @@ -48,6 +50,7 @@ impl AstBuilderImpl<'_> { && Self::transparent_mode(&member.ty) == mode }) }); + drop(definition); if !valid { self.error_logger.print_error_position(token.pos, "transparent unions require scalar members with matching calling representations and layout"); } diff --git a/src/ast/type_parser.rs b/src/ast/type_parser.rs index c6d662e..e1bbe30 100644 --- a/src/ast/type_parser.rs +++ b/src/ast/type_parser.rs @@ -596,6 +596,7 @@ impl AstBuilderImpl<'_> { .print_error_position(token.pos, "struct tag is already defined"); } let mut members: Vec = vec![]; + let mut member_names = std::collections::BTreeSet::new(); let mut size = 0usize; let mut bit_address = 0usize; let mut has_bit_fields = false; @@ -753,35 +754,20 @@ impl AstBuilderImpl<'_> { }; if name.is_some() || matches!(member_type.unqualified(), Type::Struct(_)) { let anonymous = name.is_none(); - let visible = if anonymous { + // Index visible names once; avoid rescanning all preceding members. + let mut insert_name = |name: &str| { + if !member_names.insert(name.to_owned()) { + self.error_logger + .print_error_position(position.pos, "duplicate struct member"); + } + }; + if anonymous { let Type::Struct(child) = member_type.unqualified() else { unreachable!() }; - child - .visible_members() - .into_iter() - .map(|(name, _)| name) - .collect::>() + child.for_each_visible_member(&mut |name, _| insert_name(name)); } else { - vec![name.as_ref().unwrap().s_value.to_string()] - }; - for existing in &members { - let existing_names = if existing.anonymous { - let Type::Struct(child) = existing.ty.unqualified() else { - unreachable!() - }; - child - .visible_members() - .into_iter() - .map(|(name, _)| name) - .collect::>() - } else { - vec![existing.name.clone()] - }; - if visible.iter().any(|name| existing_names.contains(name)) { - self.error_logger - .print_error_position(position.pos, "duplicate struct member"); - } + insert_name(&name.as_ref().unwrap().s_value); } members.push(StructMember { name: name.map_or_else( diff --git a/src/ast/validation.rs b/src/ast/validation.rs index e75e81d..69c4b55 100644 --- a/src/ast/validation.rs +++ b/src/ast/validation.rs @@ -155,7 +155,9 @@ impl AstBuilderImpl<'_> { self.validate_global_initializer(&ty.member(*index).ty, value, token); } (Type::Struct(ty), GlobalVariableData::Arr(elements)) => { - let members = ty.members(); + let definition = ty.definition(); + let definition = definition.borrow(); + let members = &definition.members; let capacity = if ty.definition().borrow().is_union { 1 } else { diff --git a/src/ctype/records.rs b/src/ctype/records.rs index ff0fabf..54fe0af 100644 --- a/src/ctype/records.rs +++ b/src/ctype/records.rs @@ -27,45 +27,59 @@ impl StructType { self.definition().borrow().members[index].clone() } pub fn visible_members(&self) -> Vec<(String, Vec)> { - self.members() - .iter() - .enumerate() - .flat_map(|(index, member)| { + let mut members = vec![]; + self.for_each_visible_member(&mut |name, path| { + members.push((name.to_owned(), path.to_vec())); + }); + members + } + + pub(crate) fn for_each_visible_member(&self, operation: &mut impl FnMut(&str, &[usize])) { + fn visit( + record: &StructType, + path: &mut Vec, + operation: &mut impl FnMut(&str, &[usize]), + ) { + let definition = record.definition(); + let definition = definition.borrow(); + for (index, member) in definition.members.iter().enumerate() { + path.push(index); if member.anonymous { let Type::Struct(child) = member.ty.unqualified() else { unreachable!() }; - child - .visible_members() - .into_iter() - .map(|(name, mut path)| { - path.insert(0, index); - (name, path) - }) - .collect() + visit(child, path, operation); } else { - vec![(member.name.clone(), vec![index])] + operation(&member.name, path); } - }) - .collect() + path.pop(); + } + } + visit(self, &mut vec![], operation); } + pub fn member_path(&self, name: &str) -> Option> { - let definition = self.definition(); - let definition = definition.borrow(); - for (index, member) in definition.members.iter().enumerate() { - if member.anonymous { - let Type::Struct(child) = member.ty.unqualified() else { - unreachable!() - }; - if let Some(mut path) = child.member_path(name) { - path.insert(0, index); - return Some(path); + fn find(record: &StructType, name: &str, path: &mut Vec) -> bool { + let definition = record.definition(); + let definition = definition.borrow(); + for (index, member) in definition.members.iter().enumerate() { + path.push(index); + if member.anonymous { + let Type::Struct(child) = member.ty.unqualified() else { + unreachable!() + }; + if find(child, name, path) { + return true; + } + } else if member.name == name { + return true; } - } else if member.name == name { - return Some(vec![index]); + path.pop(); } + false } - None + let mut path = vec![]; + find(self, name, &mut path).then_some(path) } } diff --git a/src/generator/globals.rs b/src/generator/globals.rs index 1f2684e..ae64d79 100644 --- a/src/generator/globals.rs +++ b/src/generator/globals.rs @@ -246,7 +246,9 @@ where let mut lines = vec![]; let mut end = 0; for (i, member) in struct_type - .members() + .definition() + .borrow() + .members .iter() .take(if struct_type.definition().borrow().is_union { 1 diff --git a/src/generator/llvm/generator/globals.rs b/src/generator/llvm/generator/globals.rs index 4759ca5..8837e0b 100644 --- a/src/generator/llvm/generator/globals.rs +++ b/src/generator/llvm/generator/globals.rs @@ -93,7 +93,9 @@ impl IrGenerator<'_> { record.definition().borrow().packing.is_some() || ty.contains_typedef_alignment() || record - .members() + .definition() + .borrow() + .members .iter() .any(|member| Self::contains_packed_record(&member.ty)) } @@ -303,7 +305,9 @@ impl IrGenerator<'_> { if let Some(GlobalVariableData::Arr(elements)) = data { let mut fields = vec![]; let mut offset = 0usize; - for (index, member) in struct_type.members().iter().enumerate() { + for (index, member) in + struct_type.definition().borrow().members.iter().enumerate() + { let aligned_offset = offset.div_ceil(member.ty.align_of()) * member.ty.align_of(); if member.offset > aligned_offset { diff --git a/src/global.rs b/src/global.rs index f8c4033..f5f2f4f 100644 --- a/src/global.rs +++ b/src/global.rs @@ -64,7 +64,7 @@ pub fn initializer_bytes( } else { 0 }; - for (index, member) in st.members().iter().enumerate() { + for (index, member) in st.definition().borrow().members.iter().enumerate() { if union && index != selected { continue; } diff --git a/tests/cases/expressions.rs b/tests/cases/expressions.rs index eaef347..ab3c5df 100644 --- a/tests/cases/expressions.rs +++ b/tests/cases/expressions.rs @@ -324,12 +324,20 @@ fn anonymous_aggregate_members(output_option: &str) { #[test_matrix([ "struct Duplicate{int x;union{int x;};};int main(){return 0;}", "struct Nested{struct{int x;};union{int x;};};int main(){return 0;}", + "struct Deep{union{struct{int x;};};int x;};int main(){return 0;}", + "struct Deep{int x;union{struct{int x;};};};int main(){return 0;}", "struct Qualified{struct{int x;};};int main(){const struct Qualified s={{1}};s.x=2;return 0;}", ])] fn rejects_invalid_anonymous_aggregate_members(code: &str) { assert_frontend_error(code); } +#[test_matrix(["asm", "llvm"])] +fn named_members_keep_nested_names_in_their_own_scope(output_option: &str) { + let code = "struct S{struct{int value;} named;union{struct{int value;};};};struct S g={.named={3},.value=7};int main(){struct S s={.named={5},.value=9};return g.named.value!=3 || g.value!=7 || s.named.value!=5 || s.value!=9;}"; + assert_eq!(compile_and_run(code, output_option).status.code(), Some(0)); +} + #[test_matrix(["asm", "llvm"])] fn glibc_integer_word_mode(output_option: &str) { let code = "typedef int word __attribute__((__mode__(__word__)));typedef unsigned int uword __attribute__((mode(word)));struct Counter{__extension__ unsigned long long value;};int main(){word x=-1;uword y=0xffffffffffffffffUL;struct Counter c={7};return sizeof(word)!=8 || sizeof(uword)!=8 || x>=0 || y!=0xffffffffffffffffUL || c.value!=7;}"; diff --git a/tools/benchmarks/README.md b/tools/benchmarks/README.md index 926f477..0ec7a0b 100644 --- a/tools/benchmarks/README.md +++ b/tools/benchmarks/README.md @@ -103,3 +103,12 @@ For the experimental LLVM tools backend, set `DYNAMITE_BACKEND=llvm` and select matching `DYNAMITE_LLC`, `DYNAMITE_OPT`, and `DYNAMITE_LLD` executables. Use `--no-trace`, since Clang time-trace options are unsupported on that path. Preprocessing always uses Dynamite's native implementation. + +## Record-member scaling + +Build and run `cargo run --release --example profile_record_members -- INPUT.i ...` +to measure tokenization, AST construction and teardown for synthetic wide records, +a fully initialized record, and optional already-preprocessed application inputs. +The example prints warm-run medians and excludes file reads and IR generation. +See the [record-member measurements](results/linux-x86_64-2026-10-18-record-members.md) +for the baseline comparison, Clang CLI timings and measurement boundaries. diff --git a/tools/benchmarks/results/linux-x86_64-2026-10-18-record-members.json b/tools/benchmarks/results/linux-x86_64-2026-10-18-record-members.json new file mode 100644 index 0000000..15307ea --- /dev/null +++ b/tools/benchmarks/results/linux-x86_64-2026-10-18-record-members.json @@ -0,0 +1,312 @@ +{ + "baseline_revision": "7804347c97ee021bfac6c7b1a3e6558ec8fb3f40", + "candidate": "record-member changes in this PR", + "rust": "1.86.0 release", + "cpu": "Intel Core i5-5575R @ 2.80GHz", + "platform": "Linux x86_64", + "clang": "Ubuntu Clang 15.0.7", + "cpu_affinity": 0, + "frontend_method": "one warmup, median of 9 samples; 5 iterations/sample for synthetic cases, 1 for application inputs; tokenize + parse + teardown, no IR generation", + "frontend_median_ms": { + "before": { + "wide-128": 0.4686, + "wide-512": 6.0518, + "wide-2048": 87.9828, + "initialized-512": 354.3899, + "temp/build-benchmark/measured-final/matched/redis-adlist.i": 3.8311, + "temp/build-benchmark/measured-final/matched/redis-server.i": 91.1684, + "temp/build-benchmark/measured-final/matched/git-abspath.i": 54.8864, + "temp/build-benchmark/measured-final/matched/git-revision.i": 121.0991 + }, + "after": { + "wide-128": 0.1581, + "wide-512": 0.4795, + "wide-2048": 1.8264, + "initialized-512": 290.354, + "temp/build-benchmark/measured-final/matched/redis-adlist.i": 3.7668, + "temp/build-benchmark/measured-final/matched/redis-server.i": 82.9814, + "temp/build-benchmark/measured-final/matched/git-abspath.i": 54.7838, + "temp/build-benchmark/measured-final/matched/git-revision.i": 116.2238 + } + }, + "sources": { + "redis": { + "commit": "498ecd0d6d007db11ddb3aea9428552598a78622" + }, + "git": { + "commit": "a018953688f1b10bddf91bff8747068f5f4746a4" + } + }, + "inputs": { + "redis-adlist.i": { + "bytes": 46370, + "sha256": "2f43aa433b2992ea436eb18fb0fd9636863ad69d8509d530c6209bcc97b7a9bb" + }, + "redis-server.i": { + "bytes": 738169, + "sha256": "908c6aee6336ef9520bd74784696dd10bcf6a258d01a4f9451bd104c5f9ed5e2" + }, + "git-abspath.i": { + "bytes": 788201, + "sha256": "1079d3658eb36eb665d846024b17c8109554ead11aa535b72f8a4192eb67aca1" + }, + "git-revision.i": { + "bytes": 1138115, + "sha256": "e971d8edcf66d4865d92df8e4201cb792f791cd0560a718f0b0381659d965acd" + } + }, + "cli": { + "redis-adlist": { + "commands": { + "before": [ + "/tmp/dynamite-refactor-baseline-cebd/target/release/dynamite_compiler", + "-o", + "llvm", + "temp/build-benchmark/measured-final/matched/redis-adlist.i" + ], + "after": [ + "target/release/dynamite_compiler", + "-o", + "llvm", + "temp/build-benchmark/measured-final/matched/redis-adlist.i" + ], + "clang": [ + "/usr/bin/clang-15", + "-x", + "cpp-output", + "-std=gnu99", + "-O0", + "-g0", + "-S", + "-emit-llvm", + "temp/build-benchmark/measured-final/matched/redis-adlist.i", + "-o", + "/dev/null" + ] + }, + "samples_ms": { + "before": [ + 11.379504576325417, + 11.128880083560944, + 11.210069991648197, + 11.495542712509632, + 11.11488789319992, + 11.877103708684444, + 11.242825537919998 + ], + "after": [ + 11.25767920166254, + 11.369181796908379, + 11.128504760563374, + 11.48307416588068, + 11.0279880464077, + 11.427920311689377, + 10.966186411678791 + ], + "clang": [ + 35.58290749788284, + 34.48469564318657, + 34.80815514922142, + 36.514787934720516, + 34.46935210376978, + 35.39296332746744, + 34.72982160747051 + ] + }, + "median_ms": { + "before": 11.242825537919998, + "after": 11.25767920166254, + "clang": 34.80815514922142 + } + }, + "redis-server": { + "commands": { + "before": [ + "/tmp/dynamite-refactor-baseline-cebd/target/release/dynamite_compiler", + "-o", + "llvm", + "temp/build-benchmark/measured-final/matched/redis-server.i" + ], + "after": [ + "target/release/dynamite_compiler", + "-o", + "llvm", + "temp/build-benchmark/measured-final/matched/redis-server.i" + ], + "clang": [ + "/usr/bin/clang-15", + "-x", + "cpp-output", + "-std=gnu99", + "-O0", + "-g0", + "-S", + "-emit-llvm", + "temp/build-benchmark/measured-final/matched/redis-server.i", + "-o", + "/dev/null" + ] + }, + "samples_ms": { + "before": [ + 179.61125168949366, + 181.54531717300415, + 177.9050836339593, + 182.79555812478065, + 181.85498286038637, + 179.4761624187231, + 179.7898393124342 + ], + "after": [ + 174.01742562651634, + 171.0890056565404, + 168.32899022847414, + 169.21698302030563, + 171.60220257937908, + 175.8977361023426, + 172.56638407707214 + ], + "clang": [ + 218.4906667098403, + 215.1467353105545, + 215.17056226730347, + 217.70942024886608, + 213.41602131724358, + 213.53572886437178, + 215.40017519146204 + ] + }, + "median_ms": { + "before": 179.7898393124342, + "after": 171.60220257937908, + "clang": 215.17056226730347 + } + }, + "git-abspath": { + "commands": { + "before": [ + "/tmp/dynamite-refactor-baseline-cebd/target/release/dynamite_compiler", + "-o", + "llvm", + "temp/build-benchmark/measured-final/matched/git-abspath.i" + ], + "after": [ + "target/release/dynamite_compiler", + "-o", + "llvm", + "temp/build-benchmark/measured-final/matched/git-abspath.i" + ], + "clang": [ + "/usr/bin/clang-15", + "-x", + "cpp-output", + "-std=gnu99", + "-O0", + "-g0", + "-S", + "-emit-llvm", + "temp/build-benchmark/measured-final/matched/git-abspath.i", + "-o", + "/dev/null" + ] + }, + "samples_ms": { + "before": [ + 99.99118931591511, + 99.43537786602974, + 98.16861525177956, + 99.0181565284729, + 98.75555336475372, + 101.37390065938234, + 102.3815218359232 + ], + "after": [ + 98.76422863453627, + 99.68920424580574, + 100.07515735924244, + 99.98262021690607, + 98.87580387294292, + 99.01952371001244, + 102.06792876124382 + ], + "clang": [ + 131.34855777025223, + 126.699673011899, + 131.30623940378428, + 130.9173395857215, + 130.56845217943192, + 130.10326493531466, + 128.26349027454853 + ] + }, + "median_ms": { + "before": 99.43537786602974, + "after": 99.68920424580574, + "clang": 130.56845217943192 + } + }, + "git-revision": { + "commands": { + "before": [ + "/tmp/dynamite-refactor-baseline-cebd/target/release/dynamite_compiler", + "-o", + "llvm", + "temp/build-benchmark/measured-final/matched/git-revision.i" + ], + "after": [ + "target/release/dynamite_compiler", + "-o", + "llvm", + "temp/build-benchmark/measured-final/matched/git-revision.i" + ], + "clang": [ + "/usr/bin/clang-15", + "-x", + "cpp-output", + "-std=gnu99", + "-O0", + "-g0", + "-S", + "-emit-llvm", + "temp/build-benchmark/measured-final/matched/git-revision.i", + "-o", + "/dev/null" + ] + }, + "samples_ms": { + "before": [ + 223.81661366671324, + 220.79573012888432, + 217.82646887004375, + 217.12689194828272, + 245.81171106547117, + 219.63510010391474, + 221.01430501788855 + ], + "after": [ + 217.06718858331442, + 214.02322500944138, + 217.64389798045158, + 218.39752607047558, + 230.97717761993408, + 215.00590723007917, + 217.856515198946 + ], + "clang": [ + 244.46686916053295, + 245.47432269901037, + 243.45826916396618, + 244.57107577472925, + 247.8687996044755, + 243.06410364806652, + 248.69110994040966 + ] + }, + "median_ms": { + "before": 220.79573012888432, + "after": 217.64389798045158, + "clang": 244.57107577472925 + } + } + } +} diff --git a/tools/benchmarks/results/linux-x86_64-2026-10-18-record-members.md b/tools/benchmarks/results/linux-x86_64-2026-10-18-record-members.md new file mode 100644 index 0000000..40ccd3b --- /dev/null +++ b/tools/benchmarks/results/linux-x86_64-2026-10-18-record-members.md @@ -0,0 +1,74 @@ +# Record-member frontend measurements (Linux x86_64, 2026-10-18) + +The baseline is main `7804347` after the responsibility refactor; the candidate +adds the record-member changes in this PR. Both use Rust 1.86 release libraries. +Measurements ran serially on one CPU (Intel Core i5-5575R), with warm filesystem +caches and no overlapping compiler builds or regression tests. + +The change replaces repeated duplicate-name scans with a declaration-local +`BTreeSet`: O(m log m) name comparisons in the worst case for m visible names, +instead of repeatedly scanning preceding members. Anonymous-member traversal +borrows definitions and accumulates paths instead of cloning all member vectors +and repeatedly prepending path indices. Indexed initializer type access borrows +the member slice, avoiding a full vector clone for each element. `member_path` +remains a linear search; there is no persistent cache to become stale when a +publicly mutable record definition changes. + +## Tokenization, AST construction and teardown + +`examples/profile_record_members.rs` excludes input generation, file reads and IR +generation. Each number is the median of nine samples after one warmup; synthetic +samples contain five iterations and application samples one. Values are ms per +iteration. These are frontend timings, not whole-build speedups. + +| Input | Before | After | Reduction | +|---|---:|---:|---:| +| wide-128 | 0.469 | 0.158 | 66.3% | +| wide-512 | 6.052 | 0.479 | 92.1% | +| wide-2048 | 87.983 | 1.826 | 97.9% | +| initialized-512 | 354.390 | 290.354 | 18.1% | +| redis-adlist | 3.831 | 3.767 | 1.7% | +| redis-server | 91.168 | 82.981 | 9.0% | +| git-abspath | 54.886 | 54.784 | 0.2% | +| git-revision | 121.099 | 116.224 | 4.0% | + +## Clang comparison: separate CLI invocation to LLVM IR + +Identical preprocessed Redis/Git bytes were passed to each compiler. One warmup +and seven timed invocations per compiler/input ran serially on the same CPU, +reversing compiler order each round. Timings include process startup, input reads, +frontend work and writing IR to `/dev/null`; Dynamite also runs its normal native +preprocessing entrypoint on the preprocessed input. No assembler, optimizer tool, +object generation or linking is included. These command boundaries differ from +the in-process frontend table above. Small differences should be treated as noise. + +| Input | Dynamite before (ms) | Dynamite after (ms) | Clang 15 (ms) | +|---|---:|---:|---:| +| redis-adlist | 11.243 | 11.258 | 34.808 | +| redis-server | 179.790 | 171.602 | 215.171 | +| git-abspath | 99.435 | 99.689 | 130.568 | +| git-revision | 220.796 | 217.644 | 244.571 | + +Reproduce the synthetic measurements for each revision: + +```sh +cargo +1.86.0 build --release --example profile_record_members +# Pin both revisions to the same available CPU. +taskset -c 0 target/release/examples/profile_record_members /path/to/redis-server.i /path/to/git-revision.i +``` + +For an older revision without the example, compile the same example source with +`rustc +1.86.0 -O --edition=2024`, pointing `--extern dynamite_compiler` and +`-L dependency` at that revision's release library and dependency directory. +Use the existing `matched.py` benchmark to produce the representative `.i` files. +The CLI commands for each input are: + +```sh +taskset -c 0 target/release/dynamite_compiler -o llvm INPUT.i > /dev/null +taskset -c 0 clang-15 -x cpp-output -std=gnu99 -O0 -g0 -S -emit-llvm INPUT.i -o /dev/null +``` + +Source revisions, input hashes, exact measured CLI commands, all CLI samples and +frontend medians are in the [measurement snapshot](linux-x86_64-2026-10-18-record-members.json). +The unchanged full-build tables in the main README describe their earlier runs; +this experiment did not rerun clean Redis/Git builds or establish a new whole-build speedup.