I noticed that LXL is slow when reading large XML files under PUC-Lua. The problem is caused by how the library scans the document for valid XML code points. I made some changes to help mitigate it:
Implemented some of the typical Lua micro-optimizations — gratuitous use of locals, etc.
Added an option to disable the code point check (if you are dealing with machine-generated XML, which is the case 99.999% of the time, and you are confident that the output is well formed).
Added code from kikito’s utf8_validator.lua, which is faster under PUC-Lua than the existing string.byte-based implementation.
While troubleshooting LXL, improved performance of line-count logic in StringWalk.
Started a shared library module project, PILE. The hope is to standardize small snippets that I use across different projects.
Reviewed work on various serialization libraries, and compared them against Serpent by Paul Kulchenko, with a desire to just drop my efforts and stick to Serpent. I am in the middle of rewriting TableToString to be less stupid; hoping to have something out by the end of the week. Key features:
Priority keys that are serialized out before other keys in a table, in a specified order.
Safe loading of tables, using Serpent’s safe load function, plus some additional logic to 1) prohibit statements before return {… and 2) temporarily disable string methods for the duration of the load.
Writes out arrays with multiple values per line, up to a configurable maximum.