Skip to content

Suspected poor performance from rustic-syntax-propertize #107

Closed
@brownjohnf

Description

@brownjohnf

Hello! I apologize if I'm confused or misguided here, but I believe that the rustic-syntax-propertize function is locking up emacs frequently when editing any rust source file of non-trivial size. It seems that with anything larger than about 100 lines emacs becomes pretty much unusable.

This suddenly started happening a few weeks ago, and at first I thought it was my workstation, but then had the same thing happen after switching to another workstation, but only after upgrading my doom emacs installation. Unfortunately, I don't recall whether I updated rust/rls at the same time. I'm not proficient with emacs lisp, so from the little of the source I've looked at, it's unclear how much this function relies on rls for any functionality.

I tracked down this function as the culprit by running the profiler in emacs; as you can see in the screenshot, it's consuming ~75% of CPU and 55% memory during my sample run; that's pretty typical over the 2 machines and several samples I've run. Specifically, rustic-ordinary-lt-gt-p seems to be the problem function.

Screenshot from 2020-05-11 14-45-12

As I said before, this very much outside my area of expertise, so I might be completely wrong, but I'm hitting dead-ends on trying to find any other issue in other projects that explain it, so I thought I'd bring it up here. I am running nightly rust, but I've been updating frequently since hitting this issue and the problem persists, so if that's the cause it's something more than a whoops commit.

Setting syntax-propertize-function to nil appears to completely resolve the problem, but then you don't get formatting while editing. That's been my workaround today since tracking this down.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions