From 04e783be52cac4f5e46df1783e9d46bee8f566a6 Mon Sep 17 00:00:00 2001 From: Allan Ebdrup Date: Tue, 27 Jan 2015 15:38:11 +0100 Subject: [PATCH 1/2] Add is-my-son-valid to benchmarks --- benchmark/benchmark.js | 25 +- benchmark/package.json | 1 + benchmark/results.html | 6043 +++++++++++++++++++++++++--------------- 3 files changed, 3875 insertions(+), 2194 deletions(-) diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js index 578e2f6..b346756 100644 --- a/benchmark/benchmark.js +++ b/benchmark/benchmark.js @@ -9,16 +9,27 @@ var JsonSchema = require("jsonschema"); var tv4 = require("tv4"); var JsonModel = require('json-model'); var Themis = require('../src/themis'); +var imjv = require('is-my-json-valid'); Tester.registerValidator({ - name: "themis[minimal]", - setup: function (schema) { - return Themis.validator(schema, { enable_defaults: false, errors: { messages: false, validator_value: false, schema: false } }); - }, - test: function (instance, json, schema) { - return instance(json, '0').valid === true; - } + name: "is-my-json-valid", + setup: function (schema) { + return imjv(schema); + }, + test: function (instance, json, schema) { + return !!instance(json); + } +}); + +Tester.registerValidator({ + name: "themis[minimal]", + setup: function (schema) { + return Themis.validator(schema, { enable_defaults: false, errors: { messages: false, validator_value: false, schema: false } }); + }, + test: function (instance, json, schema) { + return instance(json, '0').valid === true; + } }); Tester.registerValidator({ diff --git a/benchmark/package.json b/benchmark/package.json index fc8cc76..2a4e882 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -4,6 +4,7 @@ "license": "MIT", "dependencies": { "benchmark": "latest", + "is-my-json-valid": "^2.0.3", "jayschema": "latest", "jjv": "latest", "json-model": "latest", diff --git a/benchmark/results.html b/benchmark/results.html index 6477c6c..4dfab12 100644 --- a/benchmark/results.html +++ b/benchmark/results.html @@ -25,36 +25,44 @@ -Generated on Monday, November 03, 2014 in 195.65 minutes +Generated on Tuesday, January 27, 2015 in 222.93 minutes