-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timing: add generated code jit timing feature #180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cppreference doesn't have a high opinion of high_resolution_clock
:
The high_resolution_clock is not implemented consistently across different standard library implementations, and its use should be avoided.
...
Generally one should just use std::chrono::steady_clock or std::chrono::system_clock directly instead of std::chrono::high_resolution_clock: use steady_clock for duration measurements, and system_clock for wall-clock time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks mostly good to me 🙂
Could you change the bool flag to the actual feature set, as discussed, please.
Also take a look at the data[3]
idea.
e26d3bc
to
2d2ac0c
Compare
Codecov Report
@@ Coverage Diff @@
## main #180 +/- ##
==========================================
- Coverage 62.63% 62.51% -0.12%
==========================================
Files 87 87
Lines 9266 9290 +24
Branches 1533 1542 +9
==========================================
+ Hits 5804 5808 +4
- Misses 2639 2652 +13
- Partials 823 830 +7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
4e2d019
to
e2c4e49
Compare
Summary
Adds a timing call at the beginning and end of the generated code functions and store the time taken in nanoseconds in the data segment. Currently this is output at
LOG(INFO)
level. IMO this belongs in RocksDB andoid_out.json
, but it requires a bit of a format change so I'll leave it until it's necessary.This required adding another
uintptr_t
typed element to the data segment prefix, because adding it at the end of the data segment means keeping overhead of setting lengths and such after the call. Probe effect should be minimal as is, but as it's feature gated and off by default I haven't bothered measuring it. I added some names to pieces in these entry functions while I was in there, and also cleaned up a type in the typed data segment entry.Test plan
[]: make test: 100% tests passed, 0 tests failed out of 578
["-fjit-timing"]: make test: 100% tests passed, 0 tests failed out of 578
["-ftype-graph"]: make test: 95% tests passed, 31 tests failed out of 578
["-ftype-graph", "-fjit-timing"]: make test: 95% tests passed, 31 tests failed out of 578
["-ftyped-data-segment"]: make test: 87% tests passed, 77 tests failed out of 578
["-ftyped-data-segment", "-fjit-timing"]: make test: 87% tests passed, 77 tests failed out of 578
(that was hard work)