Open hoxha-saber opened 1 year ago
Thanks for this suggestion! This is definitely something to consider, but Mojo is still very young and changing quickly, so I think we should revisit this when the language and library is more mature. I believe writing this sort of documentation now will be a maintenance problem, and there are a lot of other pressing demands.
Where is the problem?
https://docs.modular.com/mojo/stdlib/utils/vector.html#setitem__-2
What can we do better?
Throughout the documentation, there are several functions that are used to manipulate data structures. I think it would be helpful as a developer to know runtime complexity of using these functions. For example, in the documentation for
unordered_map
at cppreference there is a short description of the asymptotic complexity of theinsert
method.Whereas for
std::map::insert
we have something likeAs Mojo evolves and new data structures are added it would be helpful as a developer to get a basic idea of the runtimes for different functions/data structures.
Anything else?
I put a link to
__setitem__
function ofDynamicVector
but it really applies to any/all non-trivial functions.