I have an unfounded conspiracy theory in #rustlang that heap allocations only look close in perf to stack allocations because Rust promotes return of large structs, but also lacks guaranteed [N]RVO, and if we had that, many stacky things would be much faster and memory friendly.
-
Show this thread
-
Replying to @bitshiftmask
Oh that sounds interesting! For the uninitiated: what's (N)RVO? Should I read the issue to find out?
2 replies 0 retweets 0 likes -
Replying to @yoshuawuyts @bitshiftmask
return value optimization, instead of doing a stack copy on returning something, the function knows that the returned value is supposed to be stored in <some stack location> and directs all reads/writes directly to it
1 reply 0 retweets 2 likes -
Replying to @ManishEarth @yoshuawuyts
(this is a better explanation of the optimization compared to the problem)
1 reply 0 retweets 2 likes
Replying to @bitshiftmask @ManishEarth
Thank you both! I think I get it now!
1:28 PM - 7 Aug 2019
from Berlin, Germany
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.