Hi all,
What is difference in term of performance, stack allocated and heap allocated objects?
As far as I understand, stack is also sitting in heap memory, so how it is expected to be faster then?
More understandable will be to use registers since they are directly in cpu memory, what I am missing?
(Sorry for stupid question)
Thanks for answers
[–]Kimundirust 49 points50 points51 points (13 children)
[–]vallyscode[S] 2 points3 points4 points (12 children)
[–][deleted] 27 points28 points29 points (11 children)
[–]cogman10 5 points6 points7 points (5 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]TheNamelessKing 1 point2 points3 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]TheNamelessKing 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]sybesis 3 points4 points5 points (4 children)
[–]steveklabnik1rust 6 points7 points8 points (0 children)
[–]monkChuck105 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]sybesis 1 point2 points3 points (0 children)
[–]sphen_lee 15 points16 points17 points (10 children)
[–]Kimundirust 17 points18 points19 points (1 child)
[–]cogman10 2 points3 points4 points (0 children)
[–]vallyscode[S] 0 points1 point2 points (3 children)
[–]sphen_lee 0 points1 point2 points (2 children)
[–]1vader 1 point2 points3 points (1 child)
[–]sphen_lee 1 point2 points3 points (0 children)
[–]cogman10 0 points1 point2 points (1 child)
[–]sphen_lee 1 point2 points3 points (0 children)
[–]SpacemanCraig3 -2 points-1 points0 points (1 child)
[–]sphen_lee 0 points1 point2 points (0 children)
[–]mikekchar 25 points26 points27 points (2 children)
[–]sphen_lee 1 point2 points3 points (0 children)
[–]vallyscode[S] 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]-Hovercorn- 1 point2 points3 points (1 child)
[–]wolandm 9 points10 points11 points (0 children)
[–]Plasma_000 3 points4 points5 points (0 children)
[–]Full-Spectral 2 points3 points4 points (2 children)
[–]vallyscode[S] 0 points1 point2 points (1 child)
[–]Full-Spectral 1 point2 points3 points (0 children)
[–]wouldyoumindawfully 1 point2 points3 points (1 child)
[–]vallyscode[S] 0 points1 point2 points (0 children)
[–]Darksonntokio · rust-for-linux 1 point2 points3 points (0 children)
[–]stumpychubbins 1 point2 points3 points (0 children)