5 ms·
At the moment only the line number corresponding to the start of the viewable area is cached. Further requests are served based on that. Since the underlying pi
by martanne 12y ago
At the moment only the line number corresponding to the start of the viewable area is cached. Further requests are served based on that. Since the underlying pieces/buffers remain unchanged, one could also maintain a more complex data structure such as a balanced binary search tree.
- shurcooL 12y agoWhat about uncached? Imagine the user opens a file and immediately issues a command "go to line 12345". Or is go to line not implemented at this time?
- martanne 12y agoThen the underlying file is scanned. The performance of this depends on the number of non contiguous changes made to the document. At load time i.e. with no changes this will be relatively fast since it is a single memory mapped piece/buffer. Further request are then either served from line 12345 or the start of the file, depending on which is nearer.