-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(attest): improve bench extraction, add docs on baseline expression (
- Loading branch information
1 parent
4f7a84e
commit 650931f
Showing
11 changed files
with
106 additions
and
53 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
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
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
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
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
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
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,19 +1,21 @@ | ||
import { bench } from "@ark/attest" | ||
import { scope } from "arktype" | ||
import { scope, type } from "arktype" | ||
import { cyclic10, cyclic100, cyclic500 } from "./generated/cyclic.js" | ||
|
||
type("never") | ||
|
||
bench("cyclic 10 intersection", () => { | ||
const s = scope(cyclic10).type("user&user2").infer | ||
}).types([30633, "instantiations"]) | ||
}).types([28410, "instantiations"]) | ||
|
||
bench("cyclic(10)", () => { | ||
const types = scope(cyclic10).export() | ||
}).types([7538, "instantiations"]) | ||
}).types([6558, "instantiations"]) | ||
|
||
bench("cyclic(100)", () => { | ||
const types = scope(cyclic100).export() | ||
}).types([38109, "instantiations"]) | ||
}).types([38209, "instantiations"]) | ||
|
||
bench("cyclic(500)", () => { | ||
const types = scope(cyclic500).export() | ||
}).types([169672, "instantiations"]) | ||
}).types([174572, "instantiations"]) |
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,22 +1,24 @@ | ||
import { bench } from "@ark/attest" | ||
import { type } from "arktype" | ||
|
||
type("never") | ||
|
||
bench("dictionary", () => { | ||
const dict = type({ | ||
a: "string[]", | ||
b: "number[]", | ||
c: { nested: "boolean[]" } | ||
}) | ||
}).types([5212, "instantiations"]) | ||
}).types([3175, "instantiations"]) | ||
|
||
bench("dictionary with optional keys", () => { | ||
const dict = type({ | ||
"a?": "string[]", | ||
"b?": "number[]", | ||
"c?": { "nested?": "boolean[]" } | ||
}) | ||
}).types([5051, "instantiations"]) | ||
}).types([3018, "instantiations"]) | ||
|
||
bench("tuple", () => { | ||
const tuple = type(["string[]", "number[]", ["boolean[]"]]) | ||
}).types([11888, "instantiations"]) | ||
}).types([10381, "instantiations"]) |
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
Oops, something went wrong.