Closed
Description
This is a performance test idea. It involves registering pairs of functions -- rust and rust, rust and C++, rust and LLVM -- and comparing the ratio of their outputs in terms of number of LLVM instructions and number of machine instructions.
I think this is a nice category of test because:
- it's mostly objective (subject to clang drift) and timing-insensitive so can be turned into a performance ratchet (see
make check
should use a performance ratchet #7459) - it's easy to think of new testcases that "should be equivalent"
- it's easy to turn existing performance problems into such testcases
Some examples:
- Manually inlined things vs. types of inlining we expect LLVM to do
- Same for constant propagation
- Same for type specialization
- Comparing how we do these things vs. how C++/clang does them
- Unsafe code vs. safe code for same operations
- Match constructs vs. nested ifs
- Iteration constructs vs. manual counter loops
- Destructuring vs. field access