Let bindings result in different memory and cpu usage. Why? #541
-
I am trying to add a
I then implemented an
Personally, I find all the
Using these tests, I bench marked both versions:
This is what I got:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think I figured it out. Since
In this version, I stored the result of In hindsight, this seems pretty basic... I guess I assumed those functions would only be evaluated once even though I called them twice. |
Beta Was this translation helpful? Give feedback.
I think I figured it out. Since
add_ratios2
calledx.denominator
andy.denominator
twice, I did another test with this version:In this version, I stored the result of
x.denominator
andy.denominator
in a variable and then used that variable twice instead of calling those functions twice. This version resulted in similar performance to the first version with all …