e class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#75715e"># 运行 100000 次, 统计内存分配</span>
</span></span><span style="display:flex;"><span>$ go test -run<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;^$&#39;</span> -bench<span style="color:#f92672">=</span>. -count<span style="color:#f92672">=</span><span style="color:#ae81ff">1</span> -benchtime<span style="color:#f92672">=</span>100000x -benchmem &gt; array.txt
</span></spa