I have an epoch yielding of about 20ms. When I measure the time between each poll call should I expect to see about 20ms as well? I have another thread incrementing epochs and I'm on wasmtime 17.0.2
For cpu bound work that should show up yeah. If the work is otherwise yielding though (eg for io) then the time-per-poll may be shorter
I see it might be something in my code. Have a weird issue where the time elapsed on the poll is 0 most of the time until the last poll which yields the whole thing
Did you call Store::epoch_deadline_async_yield_and_update
?
Yes I did right before I called the method. Is that the right way to do it?
It should be ok to call that only once on store creation, no need to call it once per poll
Okay will try and look at this again. Thank you!
Last question(hopefully) do I need to set deadline as well when I'm using epoch_deadline_async_yield? E.g deadline of 20ms with epoch_deadline_async_yield means after 20ms it will give back control to the async runtime?
This may have changed between 17 and 21 so I sort of forget, we had some weird interactions historically possible which is why there was a refactor. I believe all you need to do is configure yielding though
Are there any examples for epoch_deadline_async_yield_and_update? I think I have it right but the numbers still look inconsistent
I think I figured it out. I was using tokio spawn with a very short interval tick and I don't think it liked the context switch much
Levent kaya has marked this topic as resolved.
Last updated: Nov 22 2024 at 17:03 UTC