3 ms·
Code optimization tool
Would it be possible to develop a program that could optimize algorithms, detect design patterns and then rewrite the code?
It could propose various optimization strategies and the programmer would decide whether to apply them, for example:
Detect a Bubble sort and transform it into a Quick sort or a Merge sort
Replace unnecessary repetitions of instances of a class into a Singleton
Refactor similar functions into a more generic one that accepts parameters
This tool could be applicable to the sources of any programming language through configuration files containing the various rules such as grammar