jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
Compare SELECT queries on sql.js (https://github.com/kripken/sql.js/) and alasql.js (https://github.com/agershun/alasql)
<script src="http://kripken.github.io/sql.js/js/sql.js"></script>
<script src="https://cdn.rawgit.com/agershun/alasql/master/alasql.js"></script>
var NUM_TESTS = 1000;
// Generate SQL statements
var sqls = [
'DROP TABLE IF EXISTS test1',
'DROP TABLE IF EXISTS test2',
'CREATE TABLE test1 (one INT, two INT)',
'CREATE TABLE test2 (two INT, three INT)'
];
for (var i = 0; i < NUM_TESTS; i++) {
sqls.push('INSERT INTO test1 VALUES (' + i % 10 + ',' + ((i * i) % 10) + ')');
sqls.push('INSERT INTO test2 VALUES (' + i % 10 + ',' + ((i * i) % 10) + ')');
}
// Prepare SQL.JS database
var sdb = new SQL.Database();
sqls.forEach(sdb.exec, sdb);
// Prepare ALASQL.JS database
var adb = new alasql.Database();
sqls.forEach(adb.exec, adb);
// Complex query
var query = 'SELECT SUM(test1.one) AS sumone, test1.two, test2.three FROM test1 JOIN test2 ON test1.two = test2.two WHERE test1.one > 5 GROUP BY test1.two, test2.three ORDER BY three, sumone';
Ready to run.
Test | Ops/sec | |
---|---|---|
sql.js |
| ready |
alasql.js |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.