This patch introduces index benchmarks on top of the proposed LLVM benchmark pull.
Details
Diff Detail
- Repository
- rL LLVM
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 | ||
---|---|---|
1 ↗ | (On Diff #164414) | rename? (it's not just dex now, right?) |
21 ↗ | (On Diff #164414) | const char* (no globals with nontrivial constructors/destructors) |
25 ↗ | (On Diff #164414) | these should be in ns clang::clangd::<anonymous> I think? |
26 ↗ | (On Diff #164414) | 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. |
33 ↗ | (On Diff #164414) | comment? |
65 ↗ | (On Diff #164414) | 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? |
104 ↗ | (On Diff #164414) | remove dex if this isn't dex-specific? |
132 ↗ | (On Diff #164414) | 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 ↗ | (On Diff #164887) | 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.