4 ms·
> Edit: it seems like turning on optimizations seems to improve the situation quite a bit. Not sure why they were profiling the debug build. This is the most i
by firethief 6y ago
> Edit: it seems like turning on optimizations seems to improve the situation quite a bit. Not sure why they were profiling the debug build.
This is the most important point in the thread, since it invalidates the results for most purposes.
- saagarjha 6y agoNot completely, it's still 2-3 orders of magnitude slower.
- firethief 6y agoYou're right, I expected it would make a bigger difference
- dathinab 6y agoThe thing is it's not slow because rust is doing anything wrong or unoptimized, is slow because cleaning up insane amounts of memory allocations is slow. Also if you run this: ``` fn main() { ::std::thread::spawn(move || { println!("end")}); println!("Hello, world!"); } ``` You might notice that "end" might not be printed because the main thread exists before it prints and terminates the process. This means that the dropping might actually not happen if it's at the end of the program and nothing is faster then not doing the work. Also it's a not uncommon pattern in small user facing CLI to leak (memory) resources, as they (should) be cleaned up with the process termination.