Skip to content

Commit

Permalink
Improve generated operations for primitive literals
Browse files Browse the repository at this point in the history
  • Loading branch information
DZakh committed May 9, 2024
1 parent 0f444e7 commit 070ca81
Show file tree
Hide file tree
Showing 12 changed files with 155 additions and 131 deletions.
1 change: 0 additions & 1 deletion CHANGELOG_V7.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ Plan for V7:
- Tree-shakable built-in refinements (postponed)
- 2x faster serializeToJsonString
- Add S.bigint
- inline literal ints instead of embeding
- // TODO: Update doc with changes
4 changes: 2 additions & 2 deletions packages/tests/src/core/Example_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ test("Compiled parse code snapshot", t => {
t->U.assertCompiledCode(
~schema=filmSchema,
~op=#parse,
`i=>{let v0,v1,v2,v3,v8,v9,v14,v15;if(!i||i.constructor!==Object){e[15](i)}v0=i["Id"];if(typeof v0!=="number"||Number.isNaN(v0)){e[0](v0)}v1=i["Title"];if(typeof v1!=="string"){e[1](v1)}v2=i["Tags"];if(v2!==void 0&&(!Array.isArray(v2))){e[2](v2)}if(v2!==void 0){let v5;v5=[];for(let v4=0;v4<v2.length;++v4){let v7;try{v7=v2[v4];if(typeof v7!=="string"){e[3](v7)}}catch(v6){if(v6&&v6.s===s){v6.path="[\\"Tags\\"]"+\'["\'+v4+\'"]\'+v6.path}throw v6}v5.push(v7)}v3=v5}else{v3=void 0}v8=i["Rating"];try{v8===e[5]||e[6](v8);v9=v8}catch(v10){if(v10&&v10.s===s){try{v8===e[7]||e[8](v8);v9=v8}catch(v11){if(v11&&v11.s===s){try{v8===e[9]||e[10](v8);v9=v8}catch(v12){if(v12&&v12.s===s){try{v8===e[11]||e[12](v8);v9=v8}catch(v13){if(v13&&v13.s===s){e[13]([v10,v11,v12,v13])}else{throw v13}}}else{throw v12}}}else{throw v11}}}else{throw v10}}v14=i["Age"];if(v14!==void 0&&(typeof v14!=="number"||v14>2147483647||v14<-2147483648||v14%1!==0)){e[14](v14)}if(v14!==void 0){v15=v14}else{v15=void 0}return {"id":v0,"title":v1,"tags":v3===void 0?e[4]:v3,"rating":v9,"deprecatedAgeRestriction":v15,}}`,
`i=>{let v0,v1,v2,v3,v8,v9,v14,v15;if(!i||i.constructor!==Object){e[11](i)}v0=i["Id"];if(typeof v0!=="number"||Number.isNaN(v0)){e[0](v0)}v1=i["Title"];if(typeof v1!=="string"){e[1](v1)}v2=i["Tags"];if(v2!==void 0&&(!Array.isArray(v2))){e[2](v2)}if(v2!==void 0){let v5;v5=[];for(let v4=0;v4<v2.length;++v4){let v7;try{v7=v2[v4];if(typeof v7!=="string"){e[3](v7)}}catch(v6){if(v6&&v6.s===s){v6.path="[\\"Tags\\"]"+\'["\'+v4+\'"]\'+v6.path}throw v6}v5.push(v7)}v3=v5}else{v3=void 0}v8=i["Rating"];try{v8==="G"||e[5](v8);v9=v8}catch(v10){if(v10&&v10.s===s){try{v8==="PG"||e[6](v8);v9=v8}catch(v11){if(v11&&v11.s===s){try{v8==="PG13"||e[7](v8);v9=v8}catch(v12){if(v12&&v12.s===s){try{v8==="R"||e[8](v8);v9=v8}catch(v13){if(v13&&v13.s===s){e[9]([v10,v11,v12,v13])}else{throw v13}}}else{throw v12}}}else{throw v11}}}else{throw v10}}v14=i["Age"];if(v14!==void 0&&(typeof v14!=="number"||v14>2147483647||v14<-2147483648||v14%1!==0)){e[10](v14)}if(v14!==void 0){v15=v14}else{v15=void 0}return {"id":v0,"title":v1,"tags":v3===void 0?e[4]:v3,"rating":v9,"deprecatedAgeRestriction":v15,}}`,
)
})

test("Compiled serialize code snapshot", t => {
t->U.assertCompiledCode(
~schema=filmSchema,
~op=#serialize,
`i=>{let v0,v1,v2,v3,v8,v9;v0=i["tags"];if(v0!==void 0){v1=e[0](v0)}else{v1=void 0}v2=i["rating"];try{v2===e[1]||e[2](v2);v3=v2}catch(v4){if(v4&&v4.s===s){try{v2===e[3]||e[4](v2);v3=v2}catch(v5){if(v5&&v5.s===s){try{v2===e[5]||e[6](v2);v3=v2}catch(v6){if(v6&&v6.s===s){try{v2===e[7]||e[8](v2);v3=v2}catch(v7){if(v7&&v7.s===s){e[9]([v4,v5,v6,v7,])}else{throw v7}}}else{throw v6}}}else{throw v5}}}else{throw v4}}v8=i["deprecatedAgeRestriction"];if(v8!==void 0){v9=e[10](v8)}else{v9=void 0}return {"Id":i["id"],"Title":i["title"],"Tags":v1,"Rating":v3,"Age":v9,}}`,
`i=>{let v0,v1,v2,v3,v8,v9;v0=i["tags"];if(v0!==void 0){v1=e[0](v0)}else{v1=void 0}v2=i["rating"];try{v2==="G"||e[1](v2);v3=v2}catch(v4){if(v4&&v4.s===s){try{v2==="PG"||e[2](v2);v3=v2}catch(v5){if(v5&&v5.s===s){try{v2==="PG13"||e[3](v2);v3=v2}catch(v6){if(v6&&v6.s===s){try{v2==="R"||e[4](v2);v3=v2}catch(v7){if(v7&&v7.s===s){e[5]([v4,v5,v6,v7,])}else{throw v7}}}else{throw v6}}}else{throw v5}}}else{throw v4}}v8=i["deprecatedAgeRestriction"];if(v8!==void 0){v9=e[6](v8)}else{v9=void 0}return {"Id":i["id"],"Title":i["title"],"Tags":v1,"Rating":v3,"Age":v9,}}`,
)
})
4 changes: 2 additions & 2 deletions packages/tests/src/core/S_literal_Array_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module Common = {
t->U.assertCompiledCode(
~schema,
~op=#parse,
`i=>{(i===e[0]||Array.isArray(i)&&i.length===2&&i[0]===e[1]&&i[1]===true)||e[2](i);return i}`,
`i=>{(i===e[0]||Array.isArray(i)&&i.length===2&&i[0]==="bar"&&i[1]===true)||e[1](i);return i}`,
)
})

Expand All @@ -97,7 +97,7 @@ module Common = {
t->U.assertCompiledCode(
~schema,
~op=#serialize,
`i=>{(i===e[0]||Array.isArray(i)&&i.length===2&&i[0]===e[1]&&i[1]===true)||e[2](i);return i}`,
`i=>{(i===e[0]||Array.isArray(i)&&i.length===2&&i[0]==="bar"&&i[1]===true)||e[1](i);return i}`,
)
})
}
4 changes: 2 additions & 2 deletions packages/tests/src/core/S_literal_Number_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ module Common = {
test("Compiled parse code snapshot", t => {
let schema = factory()

t->U.assertCompiledCode(~schema, ~op=#parse, `i=>{i===e[0]||e[1](i);return i}`)
t->U.assertCompiledCode(~schema, ~op=#parse, `i=>{i===123||e[0](i);return i}`)
})

test("Compiled serialize code snapshot", t => {
let schema = factory()

t->U.assertCompiledCode(~schema, ~op=#serialize, `i=>{i===e[0]||e[1](i);return i}`)
t->U.assertCompiledCode(~schema, ~op=#serialize, `i=>{i===123||e[0](i);return i}`)
})
}

Expand Down
4 changes: 2 additions & 2 deletions packages/tests/src/core/S_literal_Object_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module Common = {
t->U.assertCompiledCode(
~schema,
~op=#parse,
`i=>{(i===e[0]||i&&i.constructor===Object&&Object.keys(i).length===1&&i["foo"]===e[1])||e[2](i);return i}`,
`i=>{(i===e[0]||i&&i.constructor===Object&&Object.keys(i).length===1&&i["foo"]==="bar")||e[1](i);return i}`,
)
})

Expand All @@ -126,7 +126,7 @@ module Common = {
t->U.assertCompiledCode(
~schema,
~op=#serialize,
`i=>{(i===e[0]||i&&i.constructor===Object&&Object.keys(i).length===1&&i["foo"]===e[1])||e[2](i);return i}`,
`i=>{(i===e[0]||i&&i.constructor===Object&&Object.keys(i).length===1&&i["foo"]==="bar")||e[1](i);return i}`,
)
})
}
8 changes: 6 additions & 2 deletions packages/tests/src/core/S_literal_String_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ module Common = {
test("Compiled parse code snapshot", t => {
let schema = factory()

t->U.assertCompiledCode(~schema, ~op=#parse, `i=>{i===e[0]||e[1](i);return i}`)
t->U.assertCompiledCode(~schema, ~op=#parse, `i=>{i==="ReScript is Great!"||e[0](i);return i}`)
})

test("Compiled serialize code snapshot", t => {
let schema = factory()

t->U.assertCompiledCode(~schema, ~op=#serialize, `i=>{i===e[0]||e[1](i);return i}`)
t->U.assertCompiledCode(
~schema,
~op=#serialize,
`i=>{i==="ReScript is Great!"||e[0](i);return i}`,
)
})
}
2 changes: 1 addition & 1 deletion packages/tests/src/core/S_object_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ module Compiled = {
t->U.assertCompiledCode(
~schema,
~op=#parse,
`i=>{let v0,v1,v2,v3;if(!i||i.constructor!==Object){e[6](i)}v3=i["tag"];v3===e[4]||e[5](v3);v1=i["FOO"];if(typeof v1!=="string"){e[1](v1)}v2=i["BAR"];if(typeof v2!=="boolean"){e[2](v2)}for(v0 in i){if(v0!=="tag"&&v0!=="FOO"&&v0!=="BAR"){e[0](v0)}}return {"foo":v1,"bar":v2,"zoo":e[3],}}`,
`i=>{let v0,v1,v2,v3;if(!i||i.constructor!==Object){e[5](i)}v3=i["tag"];v3===0||e[4](v3);v1=i["FOO"];if(typeof v1!=="string"){e[1](v1)}v2=i["BAR"];if(typeof v2!=="boolean"){e[2](v2)}for(v0 in i){if(v0!=="tag"&&v0!=="FOO"&&v0!=="BAR"){e[0](v0)}}return {"foo":v1,"bar":v2,"zoo":e[3],}}`,
)
},
)
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/core/S_tuple_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ module Compiled = {
t->U.assertCompiledCode(
~schema,
~op=#parse,
`i=>{let v0,v1,v2;if(!Array.isArray(i)){e[6](i)}if(i.length!==3){e[0](i.length)}v2=i["0"];v2===e[4]||e[5](v2);v0=i["1"];if(typeof v0!=="string"){e[1](v0)}v1=i["2"];if(typeof v1!=="boolean"){e[2](v1)}return {"foo":v0,"bar":v1,"zoo":e[3],}}`,
`i=>{let v0,v1,v2;if(!Array.isArray(i)){e[5](i)}if(i.length!==3){e[0](i.length)}v2=i["0"];v2===0||e[4](v2);v0=i["1"];if(typeof v0!=="string"){e[1](v0)}v1=i["2"];if(typeof v1!=="boolean"){e[2](v1)}return {"foo":v0,"bar":v1,"zoo":e[3],}}`,
)
},
)
Expand Down
10 changes: 5 additions & 5 deletions packages/tests/src/core/S_union_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test("Parses when second struct misses parser", t => {
t->U.assertCompiledCode(
~schema,
~op=#parse,
`i=>{let v0;try{i===e[0]||e[1](i);v0=i}catch(v1){if(v1&&v1.s===s){try{throw e[3];v0=i}catch(v2){if(v2&&v2.s===s){e[4]([v1,v2])}else{throw v2}}}else{throw v1}}return v0}`,
`i=>{let v0;try{i==="apple"||e[0](i);v0=i}catch(v1){if(v1&&v1.s===s){try{throw e[2];v0=i}catch(v2){if(v2&&v2.s===s){e[3]([v1,v2])}else{throw v2}}}else{throw v1}}return v0}`,
)
})

Expand All @@ -45,7 +45,7 @@ test("Serializes when second struct misses serializer", t => {
t->U.assertCompiledCode(
~schema,
~op=#serialize,
`i=>{let v0;try{i===e[0]||e[1](i);v0=i}catch(v1){if(v1&&v1.s===s){try{throw e[2];if(typeof i!=="string"){e[3](i)}v0=i}catch(v2){if(v2&&v2.s===s){e[4]([v1,v2,])}else{throw v2}}}else{throw v1}}return v0}`,
`i=>{let v0;try{i==="apple"||e[0](i);v0=i}catch(v1){if(v1&&v1.s===s){try{throw e[1];if(typeof i!=="string"){e[2](i)}v0=i}catch(v2){if(v2&&v2.s===s){e[3]([v1,v2,])}else{throw v2}}}else{throw v1}}return v0}`,
)
})

Expand Down Expand Up @@ -339,7 +339,7 @@ test("Compiled parse code snapshot", t => {
t->U.assertCompiledCode(
~schema,
~op=#parse,
`i=>{let v0;try{i===e[0]||e[1](i);v0=i}catch(v1){if(v1&&v1.s===s){try{i===e[2]||e[3](i);v0=i}catch(v2){if(v2&&v2.s===s){e[4]([v1,v2])}else{throw v2}}}else{throw v1}}return v0}`,
`i=>{let v0;try{i===0||e[0](i);v0=i}catch(v1){if(v1&&v1.s===s){try{i===1||e[1](i);v0=i}catch(v2){if(v2&&v2.s===s){e[2]([v1,v2])}else{throw v2}}}else{throw v1}}return v0}`,
)
})

Expand All @@ -352,7 +352,7 @@ test("Compiled async parse code snapshot", t => {
t->U.assertCompiledCode(
~schema,
~op=#parse,
`i=>{let v0,v1;try{i===e[0]||e[1](i);v0=e[2](i);throw v0}catch(v2){if(v2&&v2.s===s||v2===v0){try{i===e[3]||e[4](i);v1=()=>Promise.resolve(i)}catch(v3){if(v3&&v3.s===s){v1=()=>Promise.any([v2===v0?v2():Promise.reject(v2),Promise.reject(v3)]).catch(t=>{e[5](t.errors)})}else{throw v3}}}else{throw v2}}return v1}`,
`i=>{let v0,v1;try{i===0||e[0](i);v0=e[1](i);throw v0}catch(v2){if(v2&&v2.s===s||v2===v0){try{i===1||e[2](i);v1=()=>Promise.resolve(i)}catch(v3){if(v3&&v3.s===s){v1=()=>Promise.any([v2===v0?v2():Promise.reject(v2),Promise.reject(v3)]).catch(t=>{e[3](t.errors)})}else{throw v3}}}else{throw v2}}return v1}`,
)
})

Expand All @@ -363,7 +363,7 @@ test("Compiled serialize code snapshot", t => {
t->U.assertCompiledCode(
~schema,
~op=#serialize,
`i=>{let v0;try{i===e[0]||e[1](i);v0=i}catch(v1){if(v1&&v1.s===s){try{i===e[2]||e[3](i);v0=i}catch(v2){if(v2&&v2.s===s){e[4]([v1,v2,])}else{throw v2}}}else{throw v1}}return v0}`,
`i=>{let v0;try{i===0||e[0](i);v0=i}catch(v1){if(v1&&v1.s===s){try{i===1||e[1](i);v0=i}catch(v2){if(v2&&v2.s===s){e[2]([v1,v2,])}else{throw v2}}}else{throw v1}}return v0}`,
)
})

Expand Down
2 changes: 1 addition & 1 deletion packages/tests/src/core/S_variant_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ test(
t->U.assertCompiledCode(
~schema,
~op=#serialize,
`i=>{let v0,v1,v2,v3,v4;v0=i;if(v0!==e[0]){e[1](v0)}v1=e[2];v2=[];v3=v1["0"];v3===true||e[3](v3);v2["0"]=v3;v4=v1["1"];v4===e[4]||e[5](v4);v2["1"]=v4;return v2}`,
`i=>{let v0,v1,v2,v3,v4;v0=i;if(v0!==e[0]){e[1](v0)}v1=e[2];v2=[];v3=v1["0"];v3===true||e[3](v3);v2["0"]=v3;v4=v1["1"];v4===12||e[4](v4);v2["1"]=v4;return v2}`,
)
},
)
Expand Down
117 changes: 61 additions & 56 deletions src/S_Core.bs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,50 @@ function build(builder, schema, operation) {
return new Function("e", "s", "return " + inlinedFunction)(b.e, symbol);
}

function value(literal) {
return literal.value;
}

function isJsonable(literal) {
return literal.j;
}

function toString(literal) {
return literal.s;
}

function arrayCheckBuilder(b, inputVar, literal) {
var items = literal.i;
return "(" + inputVar + "===" + ("e[" + (b.e.push(literal.value) - 1) + "]") + "||Array.isArray(" + inputVar + ")&&" + inputVar + ".length===" + items.length + (
items.length > 0 ? "&&" + items.map(function (literal, idx) {
return literal.b(b, inputVar + "[" + idx + "]", literal);
}).join("&&") : ""
) + ")";
}

function dictCheckBuilder(b, inputVar, literal) {
var items = literal.i;
var fields = Object.keys(items);
var numberOfFields = fields.length;
return "(" + inputVar + "===" + ("e[" + (b.e.push(value) - 1) + "]") + "||" + inputVar + "&&" + inputVar + ".constructor===Object&&Object.keys(" + inputVar + ").length===" + numberOfFields + (
numberOfFields > 0 ? "&&" + fields.map(function (field) {
var literal = items[field];
return literal.b(b, inputVar + "[" + JSON.stringify(field) + "]", literal);
}).join("&&") : ""
) + ")";
}

function inlinedStrictEqualCheckBuilder(param, inputVar, literal) {
return inputVar + "===" + literal.s;
}

function strictEqualCheckBuilder(b, inputVar, literal) {
return inputVar + "===" + ("e[" + (b.e.push(literal.value) - 1) + "]");
}

var undefined_value = undefined;

function undefined_b(param, param$1, inputVar) {
function undefined_b(param, inputVar, param$1) {
return inputVar + "===void 0";
}

Expand All @@ -353,21 +394,17 @@ var $$undefined = {

var null_value = null;

function null_b(param, param$1, inputVar) {
return inputVar + "===null";
}

var $$null = {
kind: "Null",
value: null_value,
s: "null",
b: null_b,
b: inlinedStrictEqualCheckBuilder,
j: true
};

var nan_value = NaN;

function nan_b(param, param$1, inputVar) {
function nan_b(param, inputVar, param$1) {
return "Number.isNaN(" + inputVar + ")";
}

Expand All @@ -379,10 +416,6 @@ var nan = {
j: false
};

function strictEqualCheckBuilder(b, value, inputVar) {
return inputVar + "===" + ("e[" + (b.e.push(value) - 1) + "]");
}

function parseInternal(value) {
var typeOfValue = typeof value;
if (typeOfValue === "symbol") {
Expand All @@ -394,22 +427,19 @@ function parseInternal(value) {
j: false
};
} else if (typeOfValue === "boolean") {
var string = value ? "true" : "false";
return {
kind: "Boolean",
value: value,
s: string,
b: (function (param, param$1, inputVar) {
return inputVar + "===" + string;
}),
s: value ? "true" : "false",
b: inlinedStrictEqualCheckBuilder,
j: true
};
} else if (typeOfValue === "string") {
return {
kind: "String",
value: value,
s: JSON.stringify(value),
b: strictEqualCheckBuilder,
b: inlinedStrictEqualCheckBuilder,
j: true
};
} else if (typeOfValue === "function") {
Expand All @@ -426,36 +456,30 @@ function parseInternal(value) {
} else if (Array.isArray(value)) {
var items = [];
var isJsonable = true;
var string$1 = "[";
var string = "[";
for(var idx = 0 ,idx_finish = value.length; idx < idx_finish; ++idx){
var itemValue = value[idx];
var itemLiteral = parseInternal(itemValue);
if (isJsonable && !itemLiteral.j) {
isJsonable = false;
}
if (idx !== 0) {
string$1 = string$1 + ",";
string = string + ",";
}
string$1 = string$1 + itemLiteral.s;
string = string + itemLiteral.s;
items.push(itemLiteral);
}
return {
kind: "Array",
value: value,
s: string$1 + "]",
b: (function (b, value, inputVar) {
return "(" + inputVar + "===" + ("e[" + (b.e.push(value) - 1) + "]") + "||Array.isArray(" + inputVar + ")&&" + inputVar + ".length===" + items.length + (
items.length > 0 ? "&&" + items.map(function (literal, idx) {
return literal.b(b, literal.value, inputVar + "[" + idx + "]");
}).join("&&") : ""
) + ")";
}),
s: string + "]",
b: arrayCheckBuilder,
j: isJsonable,
i: Caml_option.some(items)
};
} else if (value.constructor === Object) {
var items$1 = {};
var string$2 = "{";
var string$1 = "{";
var isJsonable$1 = true;
var fields = Object.keys(value);
var numberOfFields = fields.length;
Expand All @@ -467,23 +491,16 @@ function parseInternal(value) {
isJsonable$1 = false;
}
if (idx$1 !== 0) {
string$2 = string$2 + ",";
string$1 = string$1 + ",";
}
string$2 = string$2 + (JSON.stringify(field) + ":" + itemLiteral$1.s);
string$1 = string$1 + (JSON.stringify(field) + ":" + itemLiteral$1.s);
items$1[field] = itemLiteral$1;
}
return {
kind: "Dict",
value: value,
s: string$2 + "}",
b: (function (b, value, inputVar) {
return "(" + inputVar + "===" + ("e[" + (b.e.push(value) - 1) + "]") + "||" + inputVar + "&&" + inputVar + ".constructor===Object&&Object.keys(" + inputVar + ").length===" + numberOfFields + (
numberOfFields > 0 ? "&&" + fields.map(function (field) {
var literal = items$1[field];
return literal.b(b, literal.value, inputVar + "[" + JSON.stringify(field) + "]");
}).join("&&") : ""
) + ")";
}),
s: string$1 + "}",
b: dictCheckBuilder,
j: isJsonable$1,
i: Caml_option.some(items$1)
};
Expand All @@ -506,16 +523,16 @@ function parseInternal(value) {
kind: "Number",
value: value,
s: value.toString(),
b: strictEqualCheckBuilder,
b: inlinedStrictEqualCheckBuilder,
j: true
};
}
} else {
return {
kind: "BigInt",
value: value,
s: value.toString(),
b: strictEqualCheckBuilder,
s: value.toString() + "n",
b: inlinedStrictEqualCheckBuilder,
j: false
};
}
Expand All @@ -525,18 +542,6 @@ function parse(any) {
return parseInternal(any);
}

function value(literal) {
return literal.value;
}

function isJsonable(literal) {
return literal.j;
}

function toString(literal) {
return literal.s;
}

function loop(_schema) {
while(true) {
var schema = _schema;
Expand Down Expand Up @@ -1237,7 +1242,7 @@ function literal(value) {
var literal$1 = parseInternal(value);
var operationBuilder = function (b, param, path) {
var inputVar = toVar(b, b.i);
b.c = b.c + (literal$1.b(b, value, inputVar) + "||" + raiseWithArg(b, path, (function (input) {
b.c = b.c + (literal$1.b(b, inputVar, literal$1) + "||" + raiseWithArg(b, path, (function (input) {
return {
TAG: "InvalidLiteral",
expected: literal$1,
Expand Down
Loading

1 comment on commit 070ca81

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 070ca81 Previous: 9fb2e69 Ratio
Parse string 818257664 ops/sec (±0.15%) 819064824 ops/sec (±0.11%) 1.00
Serialize string 819870267 ops/sec (±0.05%) 819779932 ops/sec (±0.08%) 1.00
Advanced object schema factory 432250 ops/sec (±0.35%) 431262 ops/sec (±0.44%) 1.00
Parse advanced object 46495709 ops/sec (±0.31%) 46671133 ops/sec (±0.42%) 1.00
Create and parse advanced object 33606 ops/sec (±0.76%) 34129 ops/sec (±0.58%) 1.02
Parse advanced strict object 22097267 ops/sec (±1.13%) 22262984 ops/sec (±0.24%) 1.01
Serialize advanced object 807208744 ops/sec (±0.18%) 807737293 ops/sec (±0.20%) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.