2 ms·
>When it comes to optimization, there's a useful adage: make it work, then make it fast. When you need something to be fast, you better design it from the star
by chmod775 6y ago
>When it comes to optimization, there's a useful adage: make it work, then make it fast.
When you need something to be fast, you better design it from the start to be fast. This is terrible advice for everything but some UI/web cases.
Speed is a feature. Not every feature can be just 'added' to existing code without changing most of it.
All of that is especially true for running simulations and the like. Whether these are fast is often determined by the architecture you decided on in the beginning.
Nowadays the world is full of libraries, frameworks, etc. that will never be as fast the competition, because they can't become fast without changing their APIs completely.
- hxtk 6y agoIt's true that there's no one-liner you can use to sum up the whole field of software engineering, but that doesn't mean none of them are useful. I completely agree that things which need to be fast should be designed structurally to be fast. But which RNG function you use in a given function is about as far you can get from an architectural decision. You shouldn't need to refactor large swathes of your codebase to accommodate a substitution of one random number generator for a faster one.