verhead when initializing a lexer, but loading a
    file from disk into Scintilla is usually more expensive. On modern computer
    systems, I see no difference in speed between Lua lexers and Scintilla&rsquo;s C++
    ones. Optimize lexers for speed by re-arranging <code>lexer.add_rule()</code> calls so
    that the most common rules match first. Do keep in mind that order matters
    for similar rules.</p>

    <p>In some cases, folding may be far more expensive than lexing, particularly
    in lexers wi