3 ms·
I have a counterargument for you: https://www.researchgate.net/publication/221200232_Algorithm_Recognition_based_on_Demand-Driven_Data-flow_Analysis https://www
by thesz 7y ago
I have a counterargument for you: https://www.researchgate.net/publication/221200232_Algorithm_Recognition_based_on_Demand-Driven_Data-flow_Analysis https://www.researchgate.net/publication/221200232_Algorithm...
It's variant called rewrite rules is used in Haskell's compiler for ages and is a heart of good vector algorithms (on par with C, including SIMD C).
I can't find a paper I read in 1998 or so where successive calls to fputc were replaced with fputs and with some other rules and same approach the OpenGL code was optimized to be as fast as possible.
It is pity that research that is twenty years old was not put into C# compiler.
And for a bonus, look at program distillation: http://meta2012.pereslavl.ru/papers/2012_Jones_Hamilton__Superlinear_Speedup_by_Program_Transformation__slides.pdf http://meta2012.pereslavl.ru/papers/2012_Jones_Hamilton__Sup...
They transform quadratic concatenation algorithm (O(n^2)) into linear one (O(n)).