Browse Source

Fixed deopts

pull/14/head
Vitaly Puzrin 10 years ago
parent
commit
1fde848a41
  1. 8
      benchmark/profile.js
  2. 2
      lib/rules_block/lheading.js
  3. 2
      lib/typographer.js

8
benchmark/profile.js

@ -6,10 +6,14 @@ var fs = require('fs');
var path = require('path');
var Remarkable = require('../');
var md = new Remarkable('commonmark');
var md = new Remarkable({
html: true,
linkify: true,
typographer: true
});
var data = fs.readFileSync(path.join(__dirname, '/samples/lorem1.txt'), 'utf8');
for (var i = 0; i < 20000; i++) {
for (var i = 0; i < 200; i++) {
md.render(data);
}

2
lib/rules_block/lheading.js

@ -17,6 +17,8 @@ module.exports = function lheading(state, startLine, endLine, silent) {
pos = state.bMarks[next] + state.tShift[next];
max = state.eMarks[next];
if (pos >= max) { return false; }
marker = state.src.charCodeAt(pos);
if (marker !== 0x2D/* - */ && marker !== 0x3D/* = */) { return false; }

2
lib/typographer.js

@ -20,6 +20,8 @@ rules.push(require('./rules_typographer/smartquotes'));
function Typographer() {
this._rules = [];
this.options = assign({}, defaults);
this.ruler = new Ruler(this.rulesUpdate.bind(this));

Loading…
Cancel
Save