This patch introduces index benchmarks on top of the proposed LLVM benchmark pull.
Details
Diff Detail
Event Timeline
The current diff is rather messy and it is also blocked by the parent revision (D50894). It is likely to change if the parent CMake structure is changed.
- Rebase on top of new code
- Simplify code structure and get rid of global state (except for two filenames coming from main())
The only problem now is that the generated output contains log strings (e.g. "Built DexIndex with estimated memory usage 63445392 bytes.", see example in the Summary), I should find a way to deal with that (since it's rather annoying). It's also the case for the dexplorer tool.
Nice and simple :-) Looks good, just some details.
clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp | ||
---|---|---|
2 | rename? (it's not just dex now, right?) | |
22 | const char* (no globals with nontrivial constructors/destructors) | |
26 | these should be in ns clang::clangd::<anonymous> I think? | |
27 | This includes reading the file contents, which I'm not sure is a useful part of the BuildDex() benchmark. You could consider splitting into loadIndex that takes content and loadIndexFromFile that takes a filename. The former would be more appropriate to time. | |
34 | comment? | |
66 | this seems a little weird - the extractQueriesFromLogs/buildDex seem to be agnostic to the index contents, but here we assume knowledge of it being LLVM. The former model is nicer, and we can extend it by using the JSON representation to add more query attributes. Can we drop this function, and ArtificialQueries->Queries? | |
105 | remove dex if this isn't dex-specific? | |
133 | BTW this also counts *destruction* time. I think that's fine, though. |
The only problem left is that I'm not sure how to run binary which is not under bin (IndexBenchmark) using llvm-lit.
But it's a benchmark.. What use could be from running it as part of the _tests_?
For test-suite (lnt) integration, i'm not sure.
Same as any other binary that isn't itself a test - make sure it works :-)
(Mostly just that it doesn't crash)
clang-tools-extra/test/clangd/benchmark-dummy.test | ||
---|---|---|
1 | i'd call this index-tools.test - it's a good integration test for global-symbol-builder, better when we add dexp to the test to verify the output. |
Then you don't actually care about the measurements, do you?
It would be a great idea to add --benchmark_min_time=0.01 so it does not actually try to measure anything good.
rename? (it's not just dex now, right?)