Unfortunately, it will be necessary to re-implement checkpoint in a different language than bash :(
The performance of the existing incremental script is very poor compared to the reference implementation.
I can only guess that the reason is either that the bash loops which iterate over all files are too slow or bash associative arrays are poorly implemented and not O(1) as they could be.

I've chosen Python as the next language which I will try. Therefore, this commit contains the skeleton for the new Python-based implementation.