b4n left a comment (geany/geany#4497)

I can confirm that even a fake 8.2M JSON file takes a *long* time to open.  
Without surprise, for me it's mostly because it generates a whole lot of tags 
(~330k), and although parsing is fairly fast, building the tree is slow[^1].

So, one workaround if you're opening huge JSON files is to disable symbols 
parsing for those, which you can do with adding this to *filetypes.JSON.conf*:
```conf
[settings]
tag_parser=None
```
Another is to treat the file as plain text, by adjusting recognition of 
*\*.json* files.

> If I turn off Line Wrapping (on by default), it takes <2 minutes.

AFAICT Line Wrapping is *off* by default.  By anyway, that suggests that line 
wrapping makes this slow, and that's another issue, maybe worth seeing with 
[Scintilla](https://scintilla.org) if it can be improved.

All this said, and although we should strive at better support for this, Geany 
isn't really targeted at opening 1G data files, and we know overly long lines 
(1G on one line definitely applies) are known to be fairly slow.

This said (again), maybe we should have a warning or automatically disable tags 
when we have maybe more than a couple thousands, to limit the pathological 
cases like this.

[^1]: a profiling run suggests it's all because of `gtk_tree_store_get_path()` 
inside a couple GTK functions, mostly `gtk_tree_store_insert_with_values()` -- 
nothing easy to fix I'm afraid

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/4497#issuecomment-3693135365
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/4497/[email protected]>

Reply via email to