Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- speed up compile times by orders of magnitude - native bindings with JS fallback - fully compatible (except unsafe) - Will attempt to compile on install - If that fails, will try precompiled version - If that fails, will fall back to JS version - Add more tests to catch previously untested bugs - Make the extra tokens algorithm more forgiving - Add benchmarks for compilation - Build binaries with CI - benchchpress-rs in a separate repo with a git submodule here
- Loading branch information
Showing
25 changed files
with
493 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*.jst | ||
build | ||
coverage | ||
.nyc_output | ||
.nyc_output | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "rust/benchpress-rs"] | ||
path = rust/benchpress-rs | ||
url = https://github.com/benchpressjs/benchpress-rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule benchpress-rs
added at
85dfe5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const fs = require('fs'); | ||
const async = require('async'); | ||
|
||
const benchpress = require('../../build/lib/benchpress'); | ||
|
||
const templatePaths = ['categories.tpl', 'topic.tpl'].map(name => path.join(__dirname, name)); | ||
|
||
function prep(callback) { | ||
async.waterfall([ | ||
next => async.map( | ||
templatePaths, | ||
(templatePath, cb) => fs.readFile(templatePath, 'utf8', cb), | ||
next | ||
), | ||
([categories, topics], next) => { | ||
function bench(deferred) { | ||
return benchpress.precompile(categories, { native: false }) | ||
.then(() => benchpress.precompile(topics, { native: false })) | ||
.then(() => deferred.resolve(), err => deferred.reject(err)); | ||
} | ||
|
||
function benchNative(deferred) { | ||
return benchpress.precompile(categories, { native: true }) | ||
.then(() => benchpress.precompile(topics, { native: true })) | ||
.then(() => deferred.resolve(), err => deferred.reject(err)); | ||
} | ||
|
||
next(null, { bench, benchNative }); | ||
}, | ||
], callback); | ||
} | ||
|
||
module.exports = prep; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.