-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Large file support #307
Comments
Yeah, we currently do a blocking read to load files. We need to switch to On Sun, Feb 24, 2013 at 5:54 PM, Joel Watson notifications@github.comwrote:
|
I just tried opening a 124MB JSON file directly from the CLI and got this:
|
This moved forward after #939. But there is still some telepath work to get the rest working. Adding single-user mode to telepath that eliminates the need for each character to have a location may be a solution. |
I'm failing to open up a 1.4MB HTML file with the same Running Version 0.105 Full error:
Thanks |
Opening files larger than 2MB is an edge case that most users don't run into, but I wanted to investigate this. How to create a large fileDownload this file and run it Good newsAtom handles 5MB without changing anything. Bad newsAtom hangs when opening a a file >10MB. Atom eats up ~300MB or RAM when opening large files. |
I modified window-bootstrap to test out some memory assumptions. Here is the memory footprint of Atom using a file size of 40MB Baseline (window-bootstrap.coffee does nothing): 50MB |
I'm thinking we probably need to store the |
But there's also a ton of other data such as tokenization etc. |
Node's Buffer stores data in C++ heap. But if we want to support really big files we have to avoid reading the whole file in memory. |
Interested in any ideas you have about the design of that @zcbenz. The hardest part might be a bunch of APIs might need to go async to support loading more of the file for certain operations, which could make for more awkward scripting. |
The basic idea is to only draw the file on needed, but it will need a good caching strategy to make things smooth since drawing file would rely on disk IO, many native apps use memory-mapped files to simplify it, a rough design is: when opening a large file
when user scrolls the editor view when the editor view is resized when the file is changed outside
|
I tried to open ~8gb text file, but nothing just happened :) |
I'm not sure how they do it, but Baretail is a pretty impressive log file viewer in that regard. I assume that's rather difficult to implement in Atom, maybe too much effort for the rare use case? |
@batjko Thanks for the tip. Long term we definitely want to support files of arbitrary size, but an approach that doesn't load the whole file into memory is going to force us to redesign some of our synchronous APIs to be asynchronous due to the single-threaded nature of JavaScript. We made a pragmatic decision early on to perform editor state manipulations synchronously for a more convenient scripting experience, but we may need to revisit that decision. |
@nathansobo Personally, I'm happy with it as it is. I have no use for extreme file sizes in an editor. I think the huge log file scenario is not really one for editors, but rather for viewers/greppers or whatever you might call that category. |
Yeah, I pretty much agree. I'm confident we'll get there eventually, but there's a lot of other things we consider more important right now. |
@batjko I don't think this is a rare use case, given the amount of text editors which advertise this as a feature, and the comments so far on this issue. Log viewers and greppers are nice, but it is nicer to view and edit text in an editor. After all isn't that what a text editor is for. |
The other aspect to this is the failure mode while it isn't supported. If viewing and editing large text files isn't going to work for the time being, it might still be nice to have a better failure mode than locking up and forcing the user to |
The failure mode is currently an error message displayed in the console for files exceeding 2mb, which should leave Atom in a usable state. Are you talking about large files that are < 2mb? |
Yes. This is a 1.4M (generated) Python file. |
Actually, I just tried this myself and Atom was slowing down drastically on large files like that. I thought that wasn't happening on files of that size -- I thought I tried that a while ago but I might be wrong. Sorry about that! |
Super happy to hear this is being worked on. Its not just large binary files that are issues here. Any js framework (like angular, ember) end up being too large for atom to handle. It doesn't seem like an edge case to occasionally need to look at the source of some 3rd party package you are using. |
This editor is a toy, if it can't handle large files. I'll be watching to see if Atom matures in this area. |
Agree with @erikdonohoo - this is not an edge case. You also can't open some crucial files for Ghost because it's ember.js backed (hence has large binary vendor files). |
This is a HUGE problem. 2 meg is nothing these days. As much as I like Atom, this limitation makes it pretty useless for day to day work. :-( |
I can support this - many files (let it be log files etc.) have more than 2 MB in size. This always makes you need another editor to open these files beside atom. |
This limitation is really a dealbreaker when it comes to using atom... I hope this gets improved one day. |
This should be considered a standard feature for a modern text editor. I would really love to see this feature added as Atom is such an amazing text editor. |
This is currently being worked on. The Atom team recognizes that it's a big problem, but it also needs a big rewrite in order to make everything work. See https://github.com/atom/text-document for more details. |
@50Wliu I can appreciate the work involved. Looking forward to seeing this in a future release 😄 |
Could we pin this? The extraordinary atom/text-document should be shown to I say this because Atom is historic, like several JS/Html/Browser/Node Many of Atom's clients are simply looking for a coherent text editor. On Tue, Apr 7, 2015 at 6:19 PM, Karl Bateman notifications@github.com
|
+1 |
I must admit these days the only thing keeping me from using Atom is the performance and the large file non-support. I can't wait to see this working 😁 |
+1 |
+100 |
+2.0001 (MB) ...wait for it... 😉 UPDATE: |
This is actively being worked on and is a high priority, no reason to post +1 comments anymore - it just spams everyone watching the issue. |
@thedaniel issues can be closed for commenting |
@thedaniel I think it would help if any other possible progress updates regarding perf. improvements were provided. If there aren't any, it would just be nice to know that it's happening by @nathansobo or you commenting in addition to adding the in progress label. |
It's happening. Check out the text-document repo. Out of the country for a conference which is consuming some attention, but it's been almost my sole focus. Not much more to say than the progress and write-ups you can observe there. I empathize with everyone who wants this because I want it too, and it's been challenging but we're definitely getting there. |
@thedaniel @matmuchrapna: Yup, it's simple to lock the comments while still allowing contributors to discuss things. |
I disagree this is an edge case. There are popular third-party JS libraries that are greater than this limit. What motivates my finding this bug is that Telerik's Kendo library is too big to open in Atom unless you open the minified version, which is, of course, not useful at all. I'm having to read the library in Firefox's debugger since I can't open it in Atom to read it. You can argue philosophy about whether I should be opening a file I don't intend to edit in Atom, but I might edit it if I need to and just consider it no longer a proper third party lib but rather a first party, but can't edit in Atom. |
I've locked this. We do believe this is an important case to handle. We are currently working on this. Please visit https://github.com/atom/text-document for more information. |
Just an update here... in the interest of time we've decided to refocus our efforts on more incremental improvements.
We'll be searching for several more smaller wins like this, then redirect our attention back to some of the bigger changes researched in Some ideas for other areas we plan on investigating in the next couple weeks:
Making Atom performant for files of all sizes remains a top priority. We'll continue to post updates here. |
There's still more to do here, but a basic fix for the 80% case of loading large files is now on master. Before 1.0 I'd like to fix a few performance hiccups when moving the cursor in huge files. Post 1.0 I'd like to:
We can create separate issues for all of those, but I'm going to close this one. Atom can now load and edit large files. Don't worry, we'll keep working on refining it. |
So, I use my text editor for all kinds of things (writing code, reading readmes, editing dotfiles, etc). One of the things I do most often during any given day is open up large log files to troubleshoot Enterprise problems. These files can sometimes get as large as 500-800MB.
I just tried viewing a 350MB log file and Atom locked up immediately -- the file selector didn't change and the entire window went completely white 4 seconds after I tried viewing the file. I could still close the top level window, but we should still have better handling for this kind of thing.
Sublime Text 2 took about 55 seconds to open the file, but gave a nice progress indicator while it was loading:
Once it loaded it was as responsive as any other file I load (scrolled fast, normal text highlight performance, etc). It would be nice if we set this as a baseline for expected behavior (progress bar + responsive after loading).
The text was updated successfully, but these errors were encountered: