mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-29 01:27:00 +03:00
Add benchmark for TokenizedBuffer w/ new TextMateGrammar tokenization. SO SLOW!
This commit is contained in:
parent
6878d19a6a
commit
a02af2a51f
@ -4,9 +4,14 @@ _ = require 'underscore'
|
||||
Keymap = require 'keymap'
|
||||
Point = require 'point'
|
||||
RootView = require 'root-view'
|
||||
Project = require 'project'
|
||||
TextMateBundle = require 'text-mate-bundle'
|
||||
|
||||
require 'window'
|
||||
|
||||
requireStylesheet "jasmine.css"
|
||||
TextMateBundle.loadAll()
|
||||
|
||||
RootView.prototype.loadUserConfiguration = ->
|
||||
|
||||
keymap = new Keymap
|
||||
@ -24,6 +29,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: ' '})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user