whatever
whatever
MModular
Created by whatever on 12/26/2024 in #questions
List memory preallocation
Is this the correct way to preallocate memory in Mojo?
var large_list = List[int](capacity=5)
var large_list = List[int](capacity=5)
Also with what is the memory preallocate (Null, 0,)? What is the difference between size and capacity? Does memory preallocation give me a performance improvment in Mojo?
5 replies
MModular
Created by whatever on 11/20/2024 in #questions
How are Integers implemented in Mojo?
I experiment with lists of integers in python and mojo and noticed that mojo is way more memory efficient. Is this all done thanks to the static typing or are there other Optimistin methods in play?
12 replies
MModular
Created by whatever on 10/30/2024 in #questions
How can I see the peak memory usage of a datastructure like alist in mojo?
I want to compare the memory usage of python and mojo. For python I use the memory profiler pip package. How can I get the accurate memory consumption of a list or other structure in mojo?
28 replies