| 1 | # Checked transformation sources |
| 2 | |
| 3 | This suite reconstructs the motivating shape from PR #8597: decode an Array of |
| 4 | 1,000 rows, each containing eleven pattern-checked string fields and one `n` |
| 5 | field. The sibling fields match `/^[a-z][a-z0-9]{1,15}$/`, and the checked numeric |
| 6 | source matches `/^[0-9]{1,6}$/`. Rows contain `value0` through `value999` and |
| 7 | numeric strings `1` through `1000`. Schemas, inputs and parsers are prepared |
| 8 | outside the measured callback. Each operation decodes all 1,000 rows. |
| 9 | |
| 10 | - `digits` validates the checked string without transforming it. |
| 11 | - `checked-source` converts the checked numeric string to a number. |
| 12 | - `unchecked-source` converts a plain string to a number. |
| 13 | - `two-passes` first validates all fields, then decodes the validated output |
| 14 | with a transformations-only Struct. |
| 15 | - `checked-template-target` and `unchecked-template-target` convert the `n` |
| 16 | field to a TemplateLiteral string prefixed with `x-`. They measure valid |
| 17 | input through the parser fallback required to preserve template diagnostics. |
| 18 | |
| 19 | Every worker validates the complete output before and after measuring. The |
| 20 | comparison harness copies the same fixtures into both revisions and alternates |
| 21 | base/head order in fresh Node processes. |
| 22 | |
| 23 | ```sh |
| 24 | pnpm runtimeperf-compare schema-checked-sources --base main --head HEAD \ |
| 25 | --rounds 16 --time 500 --warmup-time 150 |
| 26 | ``` |
| 27 | |
| 28 | These fixtures use repository sources. The PR's original figures used packed |
| 29 | packages on Node 26.10, so compare relative changes rather than absolute times. |