@@ -4,8 +4,8 @@ import { isDeepStrictEqual } from 'util'
44import jl from 'json-logic-js'
55import rust from '@bestow/jsonlogic-rs'
66
7- const x = new LogicEngine ( undefined , { compatible : true } )
8- const y = new AsyncLogicEngine ( undefined , { compatible : true } )
7+ const x = new LogicEngine ( )
8+ const y = new AsyncLogicEngine ( )
99
1010const compatible = [ ]
1111const incompatible = [ ]
@@ -21,8 +21,8 @@ JSON.parse(fs.readFileSync('./tests.json').toString()).forEach((test) => {
2121 compatible . push ( test )
2222 }
2323 } catch ( err ) {
24- // console.log(err)
25- // console.log(test[0])
24+ // console.log(err)
25+ // console.log(test[0])
2626 incompatible . push ( test )
2727 }
2828 }
@@ -32,6 +32,9 @@ console.log(
3232 incompatible . length ,
3333 compatible . length / ( compatible . length + incompatible . length )
3434)
35+
36+ x . optimizedMap = new WeakMap ( )
37+
3538// eslint-disable-next-line no-unused-vars
3639const defined = [
3740 [ { '+' : [ 1 , 2 , 3 , 4 , 5 ] } , { } ] ,
@@ -69,13 +72,13 @@ for (let j = 0; j < tests.length; j++) {
6972}
7073console . timeEnd ( 'json-logic-js' )
7174
72- console . time ( 'json-logic-rs' )
73- for ( let j = 0 ; j < tests . length ; j ++ ) {
74- for ( let i = 0 ; i < 1e5 ; i ++ ) {
75- rust . apply ( tests [ j ] [ 0 ] , tests [ j ] [ 1 ] )
76- }
77- }
78- console . timeEnd ( 'json-logic-rs' )
75+ // console.time('json-logic-rs')
76+ // for (let j = 0; j < tests.length; j++) {
77+ // for (let i = 0; i < 1e5; i++) {
78+ // rust.apply(tests[j][0], tests[j][1])
79+ // }
80+ // }
81+ // console.timeEnd('json-logic-rs')
7982
8083x . disableInterpretedOptimization = true
8184console . time ( 'le interpreted' )
0 commit comments