Anyway, there was then an additional issue related to the format used to write the dedup_data.lua file: this was creating a lot of very small tables, and then it was impossible for LuaJIT to load this file, producing an error stating that the “main function has more than 65536 constants”. This was an error that was
already reported and it seems the only solution was to refactor the output format to avoid writing that many sub tables. So I updated this format, remove the preovious dedup_data.lua files generated previously (as the new format was not compatible), and now everything is back in order, and I can process more that 32000 files in just a few seconds.