mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Add benchmark for tokenization.
This commit is contained in:
committed by
Corey Johnson & Nathan Sobo
parent
e5578eebee
commit
b93ee2d876
@@ -4,9 +4,12 @@ _ = require 'underscore'
|
||||
Keymap = require 'keymap'
|
||||
Point = require 'point'
|
||||
RootView = require 'root-view'
|
||||
Project = require 'project'
|
||||
|
||||
require 'window'
|
||||
|
||||
requireStylesheet "jasmine.css"
|
||||
|
||||
RootView.prototype.loadUserConfiguration = ->
|
||||
|
||||
keymap = new Keymap
|
||||
@@ -24,6 +27,8 @@ window.fbenchmark = (args...) -> window.benchmark(args..., focused: true)
|
||||
window.fpbenchmark = (args...) -> window.benchmark(args..., profile: true, focused: true)
|
||||
window.pfbenchmark = window.fpbenchmark
|
||||
|
||||
window.benchmarkFixturesProject = new Project(require.resolve 'benchmark/fixtures')
|
||||
|
||||
window.benchmark = (args...) ->
|
||||
description = args.shift()
|
||||
if typeof args[0] is 'number'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Buffer = require 'buffer'
|
||||
fs = require 'fs'
|
||||
require 'benchmark-helper'
|
||||
fs = require 'fs'
|
||||
$ = require 'jquery'
|
||||
TokenizedBuffer = require 'tokenized-buffer'
|
||||
|
||||
describe "editor.", ->
|
||||
editor = null
|
||||
@@ -79,3 +79,15 @@ describe "editor.", ->
|
||||
benchmark "move-to-beginning-of-word", ->
|
||||
editor.moveCursorToBeginningOfWord()
|
||||
editor.setCursorScreenPosition(endPosition)
|
||||
|
||||
describe "TokenizedBuffer.", ->
|
||||
describe "coffee-script-grammar.", ->
|
||||
[languageMode, buffer] = []
|
||||
|
||||
beforeEach ->
|
||||
editSession = benchmarkFixturesProject.buildEditSessionForPath('medium.coffee')
|
||||
{ languageMode, buffer } = editSession
|
||||
|
||||
pfbenchmark "construction", 5, ->
|
||||
new TokenizedBuffer(buffer, { languageMode, tabText: ' '})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user