I improved the code: Now it uses a binary search to find the first block to check. So if you want to list all transaction from one day of last year, the previous version needed hours, now only a few minutes. Probably could be improved further with web3 batch requests.