Some json files open really slow


#1

Recently Atom became very slow at opening .json files. I’m not sure why and also don’t know how to fix it. I updated to the latest version of Atom but that didn’t help. I have colorful-json, linter-jscs and language-json installed, but I’ve had them for some time, no problems in the past I think.

More info is probably needed to fix this, please let me know what you need then I’ll provide.

I should also add that it’s way worse when I have a lot of project folders open.


Atom generally slow at opening files
#2

I’ve noticed that JSON syntax files containing very long lines 500+ characters is very slow, but I don’t have any issues with JSON files with all lines close to the 80 character mark. I only have language-json installed, so if yo are experiencing something different I that might indicate an issue with the other two packages.

Versions

  • Atom: 1.8.0-beta0
  • OS: Microsoft Windows 10 Pro
  • Misc
    • apm 1.9.2
    • npm 2.13.3
    • node 0.10.40
    • python
    • git 2.7.4.windows.1
    • visual studio 2013

#3

How big is your JSON, and is it all on one line?

It does suffer a bit with single-line files, especially when you have gargantuan JSON files.

As for syntax highlighting, once a document surpasses a certain length (ie, a massive blob of JSON), it disables, by default.


#4

There are definitely big files there, multiple mbs for some. Thing is they are generated from some cache, but need to be worked on manually as well. Syntax highlighting doesn’t go far indeed, but that’s not too much of a problem. However, it seems like Atom just won’t open the files, or literally takes several minutes to open them.

Also, the above behaviour shows when I open a file by using the quickfinder or single click a file in the sidebar. But if I double click the file in de sidebar, it opens up right away, but empty.

My best guess is that it is trying to prepare it for something, maybe tries to highlight everything and then gives up. I’ve disabled the minimap package for now, and will see if that helps. I could imagine that has a hard time getting a proper minimap for such a large single line string.


#5

I believe Atom works on a line by line basis, each line is its own object, so it struggles when building a single multi-MB object.

As for syntax highlighting, that’s disabled before loading on large enough files:


#6

It seems that disabling the minimap plugin improves performance greatly. Atom still hangs for a few seconds when opening very large files but it’s nothing like before. I can now also open a lot more files at the same time without the whole interface becoming unresponsive. Definitely feels like the issue was with minimap. I’ll post an issue there just to notify the maintainers. Thanks for the input, it helped me figure out what could be it.


#7

Here’s the issue in the plugin repo: https://github.com/atom-minimap/minimap/issues/473