Githawk: Discussion: Syntax highlighting

Created on 20 Oct 2018  ·  4Comments  ·  Source: GitHawkApp/GitHawk

I am noticing a significant delay in the UI when opening a large file during syntax highlighting. Currently the UI is frozen until we’ve finished.

My example is GitHawk’s API file gql/API.swift

I’d be interested to see what could be done to allow for the task to be cancellable or in the background — to allow for the user to continue to use the other tabs / the rest of the app instead of locking the main thread?

❔ question

Most helpful comment

Yup its Highlightr and its running on the main thread. Might be able to just move this to a bg queue and call it a day.

screen shot 2018-10-20 at 4 57 23 pm

All 4 comments

Any idea if this is the syntax highlighting or the size of the file itself?

That's a good question. I've experimented with removing the highlighting and simply loading the gql/API.swift file as vanilla text and it seems to come up quickly. That's why I'm pointing a finger at the highlighter.

Should only take a quick Time Profile to figure out what the culprit is.

Yup its Highlightr and its running on the main thread. Might be able to just move this to a bg queue and call it a day.

screen shot 2018-10-20 at 4 57 23 pm

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BasThomas picture BasThomas  ·  3Comments

BasThomas picture BasThomas  ·  3Comments

BasThomas picture BasThomas  ·  3Comments

BasThomas picture BasThomas  ·  3Comments

rnystrom picture rnystrom  ·  3Comments