Commit Graph

10197 Commits

Author SHA1 Message Date
Ben Ogle
9c6353977f Rework the api using native methods. This is 🐎
editor.300-line-file.gutter-api.getLineNumberElementsForClass.DOM: 3 / 20000 = 0.00015ms
editor.300-line-file.gutter-api.getLineNumberElement.DOM: 8 / 20000 = 0.0004ms
editor.300-line-file.gutter-api.toggle-class: 17 / 2000 = 0.0085ms
editor.300-line-file.gutter-api.find-then-unset.single-class: 3 / 200 = 0.015ms
editor.300-line-file.gutter-api.find-then-unset.multiple-class: 9 / 200 = 0.045ms
2013-10-07 14:57:45 -07:00
Ben Ogle
2cee400547 More benchmarks 2013-10-07 14:56:29 -07:00
Ben Ogle
1ff97fc21a Add getLineNumbersForClass()
Also clean up and use klass
2013-10-07 13:57:00 -07:00
Ben Ogle
964e88f131 Add benchmark for the gutter api fns 2013-10-07 13:55:04 -07:00
Ben Ogle
32329070c2 Add a simple gutter api for adding/removing classes 2013-10-07 13:31:31 -07:00
Kevin Sawicki
9f7b430c02 Show window in benchmark bootstrap 2013-10-07 13:30:07 -07:00
Matt Colyer
26ab49306e Bump release notes version 2013-10-07 11:48:20 -07:00
Ben Ogle
a878d9e3da Merge pull request #901 from atom/bo-scroll-perf
Improve scrolling performance.
2013-10-07 10:36:38 -07:00
Ben Ogle
3aae7bb77e 💄 2013-10-07 10:29:02 -07:00
Ben Ogle
8825be937e TextNodeFielter -> TextNodeFilter 2013-10-07 10:29:02 -07:00
Ben Ogle
b3324b49b0 Skinny arrows 💄 2013-10-07 10:29:02 -07:00
Ben Ogle
785c71daf8 💄 2013-10-07 10:29:02 -07:00
Ben Ogle
7f9ce094c7 Add only window import so the benchmarks run 2013-10-07 10:29:01 -07:00
Ben Ogle
89b0e4d159 Fix issue when there are no client rects 2013-10-07 10:29:01 -07:00
Ben Ogle
98928dd99f Upgrade to bracket-matcher@0.6.0 2013-10-07 10:29:01 -07:00
Ben Ogle
4df546a19e Remove shoulds 2013-10-07 10:28:13 -07:00
Ben Ogle
04cdad680b Remove ability to pass clearDirtyRanges and fillDirtyRanges extra vars
We don't need them anymore in the gutter.
2013-10-07 10:28:12 -07:00
Ben Ogle
87687036cb Add benchmark for empty() vs innerHTML = '' 2013-10-07 10:28:12 -07:00
Ben Ogle
4f1bdee2d7 shift() multiple little arrays. Avoid. 2013-10-07 10:28:12 -07:00
Ben Ogle
5942f2997f Remove array joins in buildEmptyLineHtml 2013-10-07 10:28:12 -07:00
Ben Ogle
26a3a77fed Rename ALL_CAPS vars to CapCamelCase 2013-10-07 10:28:12 -07:00
Ben Ogle
a50e948a90 Remove log lines 2013-10-07 10:28:12 -07:00
Ben Ogle
bd8c14355c Move regexes out into variables 2013-10-07 10:28:12 -07:00
Ben Ogle
1a6884ff71 Remove the ALL_CAPS vars replace with CapCamelCase 2013-10-07 10:28:11 -07:00
Ben Ogle
156b6a9490 Make wrapCharacters -> escapeString. Use a regex.
The `htmlForScreenRows` benchmark went from ~3.5 ms to ~2.9ms for a 
call to htmlForScreenRows over the entire screen range.

🐎
2013-10-07 10:28:11 -07:00
Ben Ogle
407ccc4819 Get a few benchmarks in there 2013-10-07 10:28:11 -07:00
Ben Ogle
5516dadffe Remove selective gutter rendering.
It is faster but incorrect in the case of newlines. It will have to be 
rethought. It can be a different unit of work
2013-10-07 10:28:11 -07:00
Ben Ogle
f1cf8496f8 Fix test, use bufferRowsFOrScreenRowsProperly 2013-10-07 10:28:11 -07:00
Ben Ogle
b4afc24ee8 Most of the tests work 2013-10-07 10:28:11 -07:00
Ben Ogle
d0be7fbf8e Add a character width cache based on scopes.
This is slower than the position cache in the best case, but faster
in the worst and average case. With this, you can search for a space
in find and replace, and still scroll the buffer.

In editor.coffee, there are 10,500 spaces. To highlight all of them, 
the previous cache method took 7 seconds, this takes 2 when the cache 
is empty, and about 10ms when the entire file is cached.
2013-10-07 10:28:11 -07:00
Ben Ogle
8463c759b5 Use global range. Faster! Less garbage! 2013-10-07 10:28:11 -07:00
Ben Ogle
5a772d7078 Move back to the node walker and Range()
This is slower than the span compute, but rendering lines without 
tons of spans is much faster than with
2013-10-07 10:28:11 -07:00
Ben Ogle
8ab8201020 More benchmarks for text rendering 2013-10-07 10:28:10 -07:00
Ben Ogle
6eb72ac2a1 Use getElementsByClassName rather than jQuery 2013-10-07 10:28:10 -07:00
Ben Ogle
8a3f137519 Speed up token html generation. 20ms -> 6ms
Character replace was most of it. Removing regex creation, array 
creation and joins seems to reduce the GC pressure. Calling 500 times, 
GC spent 100ms less time.
2013-10-07 10:28:10 -07:00
Ben Ogle
a57c86f4ea Shortcut out of isHidden when we can.
Checking computed style is an order of magnitude more expensive than 
checking the style property.
2013-10-07 10:28:10 -07:00
Ben Ogle
8cd04b5178 Override isHidden for the Editor
We know it's visible if it is on the dom and doesn't have
display == none set. This is an order of magnitude faster than the
default implementation which calls getComputedStyle()
2013-10-07 10:28:10 -07:00
Ben Ogle
d351938702 Speed up setting the hidden input at the same place as the cursor.
Order of magnitude speedup
2013-10-07 10:28:10 -07:00
Ben Ogle
c2bb5a998b Override isHidden for the CursorView
We know it's visible if it is on the dom and doesn't have 
display == none set. This is an order of magnitude faster than the 
default implementation which calls getComputedStyle()
2013-10-07 10:28:10 -07:00
Ben Ogle
303124f1dd Add benchmarks for text rendering 2013-10-07 10:28:10 -07:00
Ben Ogle
875f0ca1e5 Get benchmarks running again: Fix imports. 2013-10-07 10:28:09 -07:00
Ben Ogle
6a494f65a5 💄 2013-10-07 10:28:09 -07:00
Ben Ogle
aa404a316d Don't allow NaNs 2013-10-07 10:28:09 -07:00
Ben Ogle
45d3fea3d0 Update only the changed line numbers 2013-10-07 10:28:09 -07:00
Ben Ogle
0ab382133b Back to display == none for $.fn.isHidden() 2013-10-07 10:28:09 -07:00
Ben Ogle
98a3bb475b Fix for non-extant lines 2013-10-07 10:28:09 -07:00
Ben Ogle
2394f25b92 Add the leftPixel cache back in 2013-10-07 10:28:09 -07:00
Ben Ogle
914288ab86 Wrap each char in a span; compute left position by measuring each span.
This is is faster and simpler than the old method. Running each function
20,000 times yielded these results:

Old: 3750ms
This method: 1523ms
By looking up each char's width in a dict: 29ms
2013-10-07 10:28:08 -07:00
Ben Ogle
aba5eb5b41 Add a cache to positionLeftForLineAndColumn()
This is the slowest function of all.
2013-10-07 10:28:08 -07:00
Ben Ogle
5c46bff4c1 Use isVisible() 2013-10-07 10:28:08 -07:00