如何在Julia中保留内存(或在没有初始化的情况下分配内存)?在C++中,常见的模式是reserve在push_back多次调用之前调用,以避免malloc不止一次调用.朱莉娅有同等的人吗?
我想你在找 sizehint!
help?> sizehint!
search: sizehint!
sizehint!(s, n)
Suggest that collection s reserve capacity for at least n elements. This can
improve performance.
Run Code Online (Sandbox Code Playgroud)