mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-06-28 00:38:30 -04:00
5291f57d7f
# Description of Changes A sort of followup to/unrevert of #4884, an alternative to #4927. In #3832, we made FunctionBudget a different unit than EnergyQuanta, but there were still many places where we treated them the same and directly converted between them. I got confused by that in #4884, and now this PR properly separates them and corrects the v8 energy calculation. Also, since we now benchmark the same module in rust and typescript in the form of the keynote benchmark, this patch adds a new assertion to that test that the fuel usage of both modules is within 2X of each other. # Expected complexity level and risk 3 - touches energy calculation without reverting the problematic #4884, but I'm confident it's correct this time. # Testing - [x] Verified that the conversion factors make sense for wasmtime and for v8. - [x] Assert that typescript and rust keynote bench runs have similar cpu usage --------- Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
⚠️ Unstable Crate ⚠️
The interface of this crate is not stable and may change without notice.