3 ms·
>compromises on runtime performance to improve compile time (which is one way you can go today) are often not seen as viable by a large part of the community.
by whatshisface 6y ago
>compromises on runtime performance to improve compile time (which is one way you can go today) are often not seen as viable by a large part of the community.
Typically this tension would be resolved with o-level flags (O1, O2, O3...).
- steveklabnik 6y agoRust has those, though most people interact with them through cargo (with --release corresponding to O3 and not passing it to O0.) Sometimes, non-release builds are too slow to meaningfully run. It is not uncommon for release builds to be extremely faster than debug builds.
- whatshisface 6y agoMight we get an -O2?
- steveklabnik 6y agoIt exists as well, and if you want to use it, it's a short "throw the option in your cargo config and call it a day." That being said, I'm not aware of it making any meaningful difference.
- staticassertion 6y agoI think the tricks are more like "use dynamic dispatch instead of static dispatch". O1 vs O3 is probably a fair way to do things. Some people will do that for debug builds, to get a mix of reasonable performance (for tests) and reasonable compile times. I'm not sure how meaningful the difference is going to be between O2 and O3, it's been a long time since I'd looked into it, and back then O3 wasn't really a thing people did.