-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
920 additions
and
987 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,44 +1,45 @@ | ||
const testData=require("../test/dataTypes/prepareTests").testData; | ||
const proto=require("../test/dataTypes/prepareTests").proto; | ||
const Benchmark = require('benchmark'); | ||
/* eslint-env mocha */ | ||
|
||
it('reads',function() { | ||
this.timeout(1000*60*10); | ||
const readSuite = new Benchmark.Suite; | ||
const testData = require('../test/dataTypes/prepareTests').testData | ||
const proto = require('../test/dataTypes/prepareTests').proto | ||
const Benchmark = require('benchmark') | ||
|
||
it('reads', function () { | ||
this.timeout(1000 * 60 * 10) | ||
const readSuite = new Benchmark.Suite() | ||
readSuite.add('read', function () { | ||
testData.forEach(tests => { | ||
tests.data.forEach(test => { | ||
test.subtypes.forEach(subType => { | ||
subType.values.forEach((value) => { | ||
proto.parsePacketBuffer(subType.type, value.buffer); | ||
}); | ||
tests.data.forEach(test => { | ||
test.subtypes.forEach(subType => { | ||
subType.values.forEach((value) => { | ||
proto.parsePacketBuffer(subType.type, value.buffer) | ||
}) | ||
}); | ||
}); | ||
}) | ||
}) | ||
}) | ||
}) | ||
.on('cycle', function (event) { | ||
console.log(String(event.target)); | ||
console.log(String(event.target)) | ||
}) | ||
.run({'async': false}); | ||
}); | ||
.run({ 'async': false }) | ||
}) | ||
|
||
it('writes',function() { | ||
this.timeout(1000*60*10); | ||
const writeSuite = new Benchmark.Suite; | ||
it('writes', function () { | ||
this.timeout(1000 * 60 * 10) | ||
const writeSuite = new Benchmark.Suite() | ||
writeSuite.add('write', function () { | ||
testData.forEach(tests => { | ||
tests.data.forEach(test => { | ||
test.subtypes.forEach(subType => { | ||
subType.values.forEach((value) => { | ||
proto.createPacketBuffer(subType.type, value.value); | ||
}); | ||
}); | ||
}); | ||
}); | ||
tests.data.forEach(test => { | ||
test.subtypes.forEach(subType => { | ||
subType.values.forEach((value) => { | ||
proto.createPacketBuffer(subType.type, value.value) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
.on('cycle', function (event) { | ||
console.log(String(event.target)); | ||
console.log(String(event.target)) | ||
}) | ||
.run({'async': false}); | ||
}); | ||
|
||
.run({ 'async': false }) | ||
}) |
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,45 +1,45 @@ | ||
const testData=require("../test/dataTypes/prepareTests").testData; | ||
const proto=require("../test/dataTypes/prepareTests").proto; | ||
const Benchmark = require('benchmark'); | ||
/* eslint-env mocha */ | ||
|
||
const testData = require('../test/dataTypes/prepareTests').testData | ||
const proto = require('../test/dataTypes/prepareTests').proto | ||
const Benchmark = require('benchmark') | ||
|
||
testData.forEach(tests => { | ||
describe(tests.kind,function(){ | ||
this.timeout(1000*60*10); | ||
describe(tests.kind, function () { | ||
this.timeout(1000 * 60 * 10) | ||
|
||
it('reads',function() { | ||
const readSuite = new Benchmark.Suite; | ||
it('reads', function () { | ||
const readSuite = new Benchmark.Suite() | ||
readSuite.add('read', function () { | ||
tests.data.forEach(test => { | ||
test.subtypes.forEach(subType => { | ||
subType.values.forEach((value) => { | ||
proto.parsePacketBuffer(subType.type, value.buffer); | ||
}); | ||
tests.data.forEach(test => { | ||
test.subtypes.forEach(subType => { | ||
subType.values.forEach((value) => { | ||
proto.parsePacketBuffer(subType.type, value.buffer) | ||
}) | ||
}); | ||
|
||
}) | ||
}) | ||
}) | ||
.on('cycle', function (event) { | ||
console.log(String(event.target)); | ||
console.log(String(event.target)) | ||
}) | ||
.run({'async': false}); | ||
}); | ||
.run({ 'async': false }) | ||
}) | ||
|
||
it('writes',function() { | ||
const writeSuite = new Benchmark.Suite; | ||
it('writes', function () { | ||
const writeSuite = new Benchmark.Suite() | ||
writeSuite.add('write', function () { | ||
tests.data.forEach(test => { | ||
test.subtypes.forEach(subType => { | ||
subType.values.forEach((value) => { | ||
proto.createPacketBuffer(subType.type, value.value); | ||
}); | ||
}); | ||
}); | ||
}) | ||
.on('cycle', function (event) { | ||
console.log(String(event.target)); | ||
proto.createPacketBuffer(subType.type, value.value) | ||
}) | ||
}) | ||
}) | ||
}) | ||
.run({'async': false}); | ||
}); | ||
}); | ||
}); | ||
|
||
.on('cycle', function (event) { | ||
console.log(String(event.target)) | ||
}) | ||
.run({ 'async': false }) | ||
}) | ||
}) | ||
}) |
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,51 +1,51 @@ | ||
const testData=require("../test/dataTypes/prepareTests").testData; | ||
const proto=require("../test/dataTypes/prepareTests").proto; | ||
const Benchmark = require('benchmark'); | ||
/* eslint-env mocha */ | ||
|
||
function testType(type,values) | ||
{ | ||
it('reads',function() { | ||
const readSuite = new Benchmark.Suite; | ||
const testData = require('../test/dataTypes/prepareTests').testData | ||
const proto = require('../test/dataTypes/prepareTests').proto | ||
const Benchmark = require('benchmark') | ||
|
||
function testType (type, values) { | ||
it('reads', function () { | ||
const readSuite = new Benchmark.Suite() | ||
readSuite.add('read', function () { | ||
values.forEach((value) => { | ||
proto.parsePacketBuffer(type, value.buffer); | ||
}); | ||
values.forEach((value) => { | ||
proto.parsePacketBuffer(type, value.buffer) | ||
}) | ||
}) | ||
.on('cycle', function (event) { | ||
console.log(String(event.target)); | ||
console.log(String(event.target)) | ||
}) | ||
.run({'async': false}); | ||
}); | ||
.run({ 'async': false }) | ||
}) | ||
|
||
it('writes',function() { | ||
const writeSuite = new Benchmark.Suite; | ||
it('writes', function () { | ||
const writeSuite = new Benchmark.Suite() | ||
writeSuite.add('write', function () { | ||
values.forEach((value) => { | ||
proto.createPacketBuffer(type, value.value); | ||
}); | ||
values.forEach((value) => { | ||
proto.createPacketBuffer(type, value.value) | ||
}) | ||
}) | ||
.on('cycle', function (event) { | ||
console.log(String(event.target)); | ||
console.log(String(event.target)) | ||
}) | ||
.run({'async': false}); | ||
}); | ||
.run({ 'async': false }) | ||
}) | ||
} | ||
|
||
testData.forEach(tests => { | ||
describe(tests.kind,function(){ | ||
this.timeout(1000*60*10); | ||
describe(tests.kind, function () { | ||
this.timeout(1000 * 60 * 10) | ||
|
||
tests.data.forEach(test => { | ||
describe(test.type,() => { | ||
describe(test.type, () => { | ||
test.subtypes.forEach((subtype) => { | ||
if(subtype.description) describe(subtype.description,() => { | ||
testType(subtype.type,subtype.values); | ||
}); | ||
else | ||
testType(subtype.type,subtype.values); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
if (subtype.description) { | ||
describe(subtype.description, () => { | ||
testType(subtype.type, subtype.values) | ||
}) | ||
} else { testType(subtype.type, subtype.values) } | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
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,59 +1,56 @@ | ||
const testData=require("../test/dataTypes/prepareTests").testData; | ||
const proto=require("../test/dataTypes/prepareTests").proto; | ||
const Benchmark = require('benchmark'); | ||
/* eslint-env mocha */ | ||
|
||
function testValue(type,value,buffer) | ||
{ | ||
it('writes',function(){ | ||
const suite = new Benchmark.Suite; | ||
suite.add('writes', function() { | ||
proto.createPacketBuffer(type,value); | ||
}) | ||
.on('cycle', function(event) { | ||
console.log(String(event.target)); | ||
}) | ||
.run({ 'async': false }); | ||
}); | ||
it('reads',function(){ | ||
const suite = new Benchmark.Suite; | ||
suite.add('read', function() { | ||
proto.parsePacketBuffer(type,buffer) | ||
const testData = require('../test/dataTypes/prepareTests').testData | ||
const proto = require('../test/dataTypes/prepareTests').proto | ||
const Benchmark = require('benchmark') | ||
|
||
function testValue (type, value, buffer) { | ||
it('writes', function () { | ||
const suite = new Benchmark.Suite() | ||
suite.add('writes', function () { | ||
proto.createPacketBuffer(type, value) | ||
}) | ||
.on('cycle', function (event) { | ||
console.log(String(event.target)) | ||
}) | ||
.on('cycle', function(event) { | ||
console.log(String(event.target)); | ||
.run({ 'async': false }) | ||
}) | ||
it('reads', function () { | ||
const suite = new Benchmark.Suite() | ||
suite.add('read', function () { | ||
proto.parsePacketBuffer(type, buffer) | ||
}) | ||
.on('cycle', function (event) { | ||
console.log(String(event.target)) | ||
}) | ||
.run({ 'async': false }); | ||
}); | ||
.run({ 'async': false }) | ||
}) | ||
} | ||
|
||
function testType(type,values) | ||
{ | ||
function testType (type, values) { | ||
values.forEach((value) => { | ||
if(value.description) | ||
describe(value.description,() => { | ||
testValue(type,value.value,value.buffer); | ||
}); | ||
else | ||
testValue(type,value.value,value.buffer); | ||
}); | ||
if (value.description) { | ||
describe(value.description, () => { | ||
testValue(type, value.value, value.buffer) | ||
}) | ||
} else { testValue(type, value.value, value.buffer) } | ||
}) | ||
} | ||
|
||
testData.forEach(tests => { | ||
describe(tests.kind,function(){ | ||
this.timeout(1000*60*10); | ||
describe(tests.kind, function () { | ||
this.timeout(1000 * 60 * 10) | ||
|
||
tests.data.forEach(test => { | ||
describe(test.type,() => { | ||
describe(test.type, () => { | ||
test.subtypes.forEach((subtype) => { | ||
if(subtype.description) | ||
describe(subtype.description,() => { | ||
testType(subtype.type,subtype.values); | ||
}); | ||
else | ||
testType(subtype.type,subtype.values); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
if (subtype.description) { | ||
describe(subtype.description, () => { | ||
testType(subtype.type, subtype.values) | ||
}) | ||
} else { testType(subtype.type, subtype.values) } | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.