I am working on an open source program that eventually I will modify to something else. I have currently had to rewrite approximately 50 % of the code to optimize its operation, resource use, and execution speed. I expect that when I have finished with the optimization I will have rewritten 80 – 90 % of the code. That is prior to branching it to what I need.
Before I branch, I will return the optimized code to the author with copious notes on what changes I have made.
My question is: how much of the original code has to be modified before the GPL looses effect?
The changes seem to be significant; as example, in one for loop I rewrote the code so that mathematical functions were pre-calculated and then only changed in the for loop when needed. This eliminated 523 calls to the calculation function. This has been typical of the entire body of the code. At one point the optimizations ran so quickly that the GUI became unstable and I had to rewrite portions of the GUI, while leaving the layout and output the same, before I could return to the math functions. I have also had to rewrite the code so that it is readable and maintainable.
The reason for my question is that while the program itself currently is a guitar/fretted instrument tuner, I plan on branching it to calculate some other features for advanced tuning methods and would like to keep the body of the code private.