-
Notifications
You must be signed in to change notification settings - Fork 214
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
Rewrite time driver #2559
base: main
Are you sure you want to change the base?
Rewrite time driver #2559
Conversation
200c14f
to
7011485
Compare
Ran the added benchmark on 0.22 and this PR: 0.22: This isn't surprising as the benchmark doesn't rely on the time driver, but at least it also means that |
db36750
to
d340d3d
Compare
@@ -123,7 +123,7 @@ This will use software-interrupt 3 which isn't available for anything else to wa | |||
|
|||
// we do not care about race conditions between the load and store operations, | |||
// interrupts will only set this value to true. | |||
if SIGNAL_WORK_THREAD_MODE[cpu].load(Ordering::SeqCst) { | |||
if SIGNAL_WORK_THREAD_MODE[cpu].load(Ordering::Acquire) { |
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.
Acquire ordering doesn't make sense here - there is no matching Release store to define a happens-before relationship with. However, for some inexplicable reason, this measures to be slightly faster than Relaxed. Manually adding a memw
instruction before a Relaxed load is significantly worse, so the change with this ordering is likely non-local.
Is the benchmark supposed to stay or is it a temporary thing? |
I'd like to keep it around |
Just asking because it looks a bit out of place here. I'm also wondering if we should have more benchmarks (for other things) in general and if we should have such a thing in parallel to |
I guess it fits well enough into |
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.
LGTM!
btw did we ever explore placing the executors in RAM? Maybe in this basic bench it won't make a difference, but I can imagine in a bigger app with esp-wifi etc it might.
Not really, but performance isn't exactly the point of this PR, just a bit of an extra. I guess we can try, but I'm also hesitant to auto-respond with "just place it in RAM" to perf issues. It may help, but eventually we'll run out of ram. We also can't place everything in RAM - we can't just inject a macro into embassy-executor for its various functions - namely |
Somewhat off-topic but I am thinking about a way to allow users to freely configure placing things in RAM - I should create an issue for that |
This PR does a few things:
Alarm
, so that we don't have to maintain an array of handlers, and we don't have to index to access initialized timers.#[handler]
functions can now be references in const context.