Skip to content

php-mode's call to php-syntax-propertize-function makes visiting large files rather slow #491

Closed
@phil-s

Description

@phil-s

The size of file involved here makes this an edge case, but I have a 450K file of machine-generated PHP, and just opening the file on even a reasonably quick PC takes 3 seconds, which is mostly accounted for by that forced call to php-syntax-propertize-function at the end of php-mode:

 - php-mode                                 2208  92%
  - php-syntax-propertize-function          2080  87%
   - syntax-ppss                            1996  83%

Does anyone have ideas for how to circumvent or reduce that?

I can see that #294 introduced this call because Emacs 25 had ceased to do it automatically, which really makes me wonder whether there's an existing Better Way which Emacs 25 expects modes to be utilising?

NEWS.25 says:

** 'syntax-propertize' is now automatically called on-demand during forward parsing functions like 'forward-sexp'.

Which sounds like ideally this up-front effort wouldn't be needed at all; but presumably it turned out that it was in practice?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions