Performance comparison to Zod for piped string
Hello!
I'm looking to implement a validator in a pretty performance critical area - so have been comparing some of the data contracts used, and in each test thrown together, ArkType is easily faster.... apart from one where a string is piped through a couple of stages
The Zod equivilant is
And for ArkType I've got
And running the tests of
In this scenario, ArkType is about 10x slower. It's still very quick, so there's no concerns about anything; I'm just wondering if I'm missing a trick when writing the type that'd speed things up?
Thanks!
I'm looking to implement a validator in a pretty performance critical area - so have been comparing some of the data contracts used, and in each test thrown together, ArkType is easily faster.... apart from one where a string is piped through a couple of stages
The Zod equivilant is
const zodTest = z.string().trim().toLowerCase().email().startsWith("info");And for ArkType I've got
const arkTest = type("string.trim |> string.lower |> string.email & /^info/");And running the tests of
zodTest.parse(" INFo@email.com")arkTest(" INFo@email.com")In this scenario, ArkType is about 10x slower. It's still very quick, so there's no concerns about anything; I'm just wondering if I'm missing a trick when writing the type that'd speed things up?
Thanks!
