@@ -4,8 +4,8 @@ import { isDeepStrictEqual } from 'util'
4
4
import jl from 'json-logic-js'
5
5
import rust from '@bestow/jsonlogic-rs'
6
6
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 ( )
9
9
10
10
const compatible = [ ]
11
11
const incompatible = [ ]
@@ -21,8 +21,8 @@ JSON.parse(fs.readFileSync('./tests.json').toString()).forEach((test) => {
21
21
compatible . push ( test )
22
22
}
23
23
} catch ( err ) {
24
- // console.log(err)
25
- // console.log(test[0])
24
+ // console.log(err)
25
+ // console.log(test[0])
26
26
incompatible . push ( test )
27
27
}
28
28
}
@@ -32,6 +32,9 @@ console.log(
32
32
incompatible . length ,
33
33
compatible . length / ( compatible . length + incompatible . length )
34
34
)
35
+
36
+ x . optimizedMap = new WeakMap ( )
37
+
35
38
// eslint-disable-next-line no-unused-vars
36
39
const defined = [
37
40
[ { '+' : [ 1 , 2 , 3 , 4 , 5 ] } , { } ] ,
@@ -69,13 +72,13 @@ for (let j = 0; j < tests.length; j++) {
69
72
}
70
73
console . timeEnd ( 'json-logic-js' )
71
74
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')
79
82
80
83
x . disableInterpretedOptimization = true
81
84
console . time ( 'le interpreted' )
0 commit comments