2023-03-30, 23:32
I've been looking at the performance of the cleaner function and have found the bottleneck. When a record gets cleaned it writes the information to the cleaner logging facility so you can see what is happening and have a log of it. However, I am writing each record and committing each one at a time when doing deletes. Thus it has to open the logging database, write the log record, commit the change and close the logging database on every log write. On my test system this takes .02 - .03 seconds per log entry thus limiting it to around 33-50 records per second (i.e. deletions). This type of logging is fine for general logging items like status messages and such which aren't in bulk like cleaning.
I am going to add a second logger to be used only by the cleaner function. It will open the database at the beginning of the clean, write all the records, commit them when done cleaning (or maybe commit after a larger number of writes maybe something like 500 or 1000) and then close the database. This should really speed things up and move any bottleneck back to MySQL. With this approach a progress display may no longer be required.
Stay tuned,
Jeff
I am going to add a second logger to be used only by the cleaner function. It will open the database at the beginning of the clean, write all the records, commit them when done cleaning (or maybe commit after a larger number of writes maybe something like 500 or 1000) and then close the database. This should really speed things up and move any bottleneck back to MySQL. With this approach a progress display may no longer be required.
Stay tuned,
Jeff