#How can I optimise this simple short script?
9 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.
I'd recommend not passing and returning std::vectors by value, this necessitates copying the entire vector
Instead of std::vector<short> sortArray(std::vector<short> array), do void sortArray(std::vector<short>& array)
For optimization it's all about knowing where to optimize. Focus on the "hot" "inner loops" of your program, that's where 90% of execution time will be spent. As a programmer don't worry about micro optimizations, your job is algorithmic optimization. You can eliminate inefficiency with copying arrays around here but really the only other place I'd say is worth optimizing is the algorithm being used for sorting.
[SOLVED] How can I optimise this simple short script?
How can I optimise this simple short script?