I would therefore like to write an alternative to this library which focuses on performance. I will also be writing in C and am happy to use the BSD license, however I don't think I will end up re-using much of the original library's code.
There are two possible approaches to writing my library:
1. Start with the code from the existing library and make changes, replacing sections of the code at a time.
2. Begin writing my library from scratch, using the existing one only for reference.
Most conventional wisdom about rewriting code (such as Joel Spolsky's famous "Things You Should Never Do, Part I" [1]), strongly recommends taking the first approach.
Is it always better to start from existing code, or are there situations in which it would be better to start from scratch?
[1] https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/