Skip to content

Extremely slow font-locking on lines with lots of dot operators #196

Description

@ryan-c-scott

GNU Emacs 28.0.50 (build 1, x86_64-w64-mingw32)

eg.
local DeadEnvironment = _G._Systems.ReplicatedStorage.src.Core.Input.ClientProcessors.DeadEnvironment

Experimenting with solutions and found that replacing:
(lua-name (symbol (seq (+ (any alpha "_")) (* (any alnum "_")))))
(lua-funcname (seq lua-name (* ws "." ws lua-name) (opt ws ":" ws lua-name)))

with

(lua-name (symbol (seq (+ (any alpha "_" ".")) (* (any alnum "_")))))
(lua-funcname (seq lua-name (* lua-name) (opt ws ":" ws lua-name)))

Resolved the performance issue, but I'm still testing on my use case to see if that affects other font-locking.

Specifically it seems to be the repeated match against 'lua-name' in 'lua-funcname'

0001-Modified-the-way-that-function-names-are-matched-in-.patch.txt

(As an aside, shocked that GH won't accept a text file with the extension ".patch")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions