File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -262,6 +262,7 @@ EditorComponent = React.createClass
262262 ' editor:scroll-to-cursor ' : => editor .scrollToCursorPosition ()
263263 ' core:page-up ' : => editor .pageUp ()
264264 ' core:page-down ' : => editor .pageDown ()
265+ ' benchmark:scroll' : @runScrollBenchmark
265266
266267 addCommandListeners : (listenersByCommandName ) ->
267268 {parentView } = @props
@@ -476,3 +477,26 @@ EditorComponent = React.createClass
476477
477478 show : ->
478479 @ setState (visible : true )
480+
481+ runScrollBenchmark : ->
482+ node = @ getDOMNode ()
483+
484+ scroll = (delta , done ) ->
485+ dispatchMouseWheelEvent = ->
486+ node .dispatchEvent (new WheelEvent (' mousewheel' , wheelDeltaX : - 0 , wheelDeltaY : - delta))
487+
488+ stopScrolling = ->
489+ clearInterval (interval)
490+ done? ()
491+
492+ interval = setInterval (dispatchMouseWheelEvent, 10 )
493+ setTimeout (stopScrolling, 500 )
494+
495+ console .timeline (' scroll' )
496+ scroll 50 , ->
497+ scroll 100 , ->
498+ scroll 200 , ->
499+ scroll 400 , ->
500+ scroll 800 , ->
501+ scroll 1600 , ->
502+ console .timelineEnd (' scroll' )
You can’t perform that action at this time.
0 commit comments