frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Fastify's slow startup is an AJV problem – here's a drop-in fix

2•greatvenerable•1h ago
When using schemas, Fastify's startup speed is heavily affected by its schema compiler, AJV. AJV compiles every schema on startup. That's not the problem. The problem is it's quite slow, and they admit this themselves on their docs: https://ajv.js.org/guide/getting-started.html The more routes, the more complex your schemas, the longer you wait. For most people this isn't a bottleneck — schemas are relatively simple and routes are few. But for serverless functions, situations where every ms counts, or where you need to compile schemas on demand, it matters. Swapping the schema compiler fixes it. 100 routes, complex schemas (allOf/oneOf/anyOf/conditionals): JetValidator has removeAdditional, useDefaults and coerceTypes enabled. AJV has none, while fastify's default also has those 3 options enabled internally

Fastify default AJV: 658ms AJV no options: 425ms @jetio/fastify-validator: 122ms

100 routes, 500 properties per schema: Same options setup.

Fastify default AJV: 69s AJV no options: 47s @jetio/fastify-validator: 2.6s

JetValidator with full options enabled. AJV with none. Still 18x faster. Benchmarks are reproducible, Run them yourself: https://github.com/official-jetio/fastify-validator

It's a custom schemaController or buildValidator for Fastify that lets you swap the compiler it uses. Two functions to drop it in: npm i @jetio/fastify-validator

const fastify = Fastify({ schemaController: createJetValidatorController({ removeAdditional: true, useDefaults: true, coerceTypes: true, }), });

Or using buildValidator directly if you need more control:

const fastify = Fastify({ schemaController: { compilersFactory: { buildValidator: createJetValidatorCompiler({ removeAdditional: true, useDefaults: true, coerceTypes: true, }), }, }, });

This was built specifically for developers who have issues with Fastify startup time or want faster startups. If you don't then you don't need this.

The package is powered by @jetio/validator, a full AJV replacement built from scratch. 19x faster compilation on average across 62 schemas. 72% overall win rate in validation. 99.5% JSON Schema compliant across drafts 06 through 2020-12. Zero dependencies. 26KB gzipped. Everything AJV does is built in, formats, custom keywords, $data, $ref, async validation and custom elseIf keyword no extra packages needed.

Fastify validator: https://github.com/official-jetio/fastify-validator Schema Builder with json schema compliant type inference: https://github.com/official-jetio/schema-builder Validator: https://github.com/official-jetio/validator Benchmarks: https://github.com/official-jetio/validator#benchmarks Docs: https://github.com/official-jetio/validator/blob/main/DOCUME...

Show HN: NumbyAI – Self-hosted personal finance app powered by a local LLM

https://github.com/RoXsaita/NumbyAI-Public
1•suheilaaita•2m ago•0 comments

MiroFish: A Simple and Universal Swarm Intelligence Engine, Predicting Anything

https://github.com/666ghj/MiroFish/blob/main/README-EN.md
1•cryptoboid•4m ago•0 comments

The Science Behind Our Obsession with a Lost "Golden Age"

https://www.iflscience.com/were-things-really-better-in-the-past-the-science-behind-our-obsession...
2•wjSgoWPm5bWAhXB•6m ago•0 comments

How Big Tech's AI Ambitions Are Fueling a Borrowing Boom

https://www.bloomberg.com/news/articles/2026-03-12/how-amazon-meta-and-google-are-fueling-a-big-t...
1•1vuio0pswjnm7•6m ago•0 comments

A Virtual Embodied Fly

https://eon.systems/updates/embodied-brain-emulation
1•geox•7m ago•0 comments

Arizona's Meteor Crater is still revealing new secrets 50k years later

https://www.space.com/stargazing/meteor-showers/arizonas-meteor-crater-is-still-revealing-new-sec...
2•Brajeshwar•8m ago•0 comments

AI Didn't Simplify Software Engineering: It Just Made Bad Engineering Easier

https://robenglander.com/writing/ai-did-not-simplify/
3•birdculture•10m ago•0 comments

The Soviet Sherlock Holmes (With English Subtitles)

https://www.youtube.com/playlist?list=PL9Wjfd0iI8ZrvDdSry_qXM_ald8_HrI9U
2•nephihaha•12m ago•1 comments

KDO: 28 Years Later

https://kottke.org/26/03/kdo-28-years-later
1•tobr•12m ago•0 comments

Incubation-Oriented Web Standards

https://blog.sgo.to/2026/03/11/incubation
1•mooreds•12m ago•0 comments

What the 2026 AI price hikes taught me about lean engineering

1•davidvartanian•14m ago•0 comments

Formulas for Pi

https://mathworld.wolfram.com/PiFormulas.html
1•dap•14m ago•0 comments

Meta weighing 20% workforce layoffs to offset AI infrastructure costs: report

https://www.foxbusiness.com/technology/meta-eyes-massive-20-workforce-cut-ai-infrastructure-costs...
2•1vuio0pswjnm7•15m ago•0 comments

Updated Debian 13: 13.4 released

https://www.debian.org/News/2026/20260314
1•allddd•16m ago•0 comments

Show HN: Data-anim – Animate HTML with just data attributes

https://github.com/ryo-manba/data-anim
1•ryo-manba•17m ago•0 comments

Analyzing OpenClaw's 3-layer defense against prompt injection

1•aunicall•17m ago•0 comments

Vesper – MCP server that lets AI agents handle ML dataset workflows autonomously

https://getvesper.dev/
1•sultanchek•21m ago•1 comments

Show HN: Pantr AI Creative Studio

https://www.pantr.co/
1•andrevaillant•21m ago•0 comments

Debauit Announced as Debian Source Package Auditor

https://www.phoronix.com/news/Debian-debaudit
3•maxloh•24m ago•0 comments

Show HN: FalconAI – AI-Powered Smart TV Streaming, Search and Voice Control

https://www.falconai-tv.com/
2•erind_musliu•24m ago•4 comments

DroneClaw: Flying a Drone with Voice Commands

https://twitter.com/Viewforge/status/2032800448269398081
1•GPUboy•25m ago•0 comments

The AI Powering Firefox's Shake to Summarize

https://blog.mozilla.org/en/firefox/firefox-ai/ai-powering-firefox-shake-to-summarize/
1•bundie•26m ago•0 comments

Zoë Kravitz: "Bluetooth does not work" [video]

https://www.youtube.com/watch?v=6iva-qFZ29c
1•sgt•27m ago•0 comments

KDE resurrects feature it killed in Plasma 5.21

https://www.neowin.net/news/good-news-for-kde-plasma-users-this-dead-feature-is-finally-being-res...
1•bundie•29m ago•0 comments

Why physical AI is becoming manufacturing's next advantage

https://www.technologyreview.com/2026/03/13/1134184/why-physical-ai-is-becoming-manufacturings-ne...
1•Brajeshwar•29m ago•1 comments

BunkerVM – Run AI agents in isolated Firecracker microVM sandboxes

https://github.com/ashishgituser/bunkervm
2•ashishch111•31m ago•0 comments

Vitest vs. Jest

https://howtotestfrontend.com/resources/vitest-vs-jest-which-to-pick
1•howToTestFE•31m ago•1 comments

Ask HN: Would this eliminate bots for good?

2•piratesAndSons•31m ago•4 comments

The most SHAMELESS structural manipulation of a index I've ever seen

https://substack.com/@georgenoble/note/c-226667679
5•Zigurd•32m ago•0 comments

Show HN: Autoresearch-WebGPU uses agents to iteratively train LMs in the browser

https://twitter.com/gucaslelfond/status/2032824470209986746
1•lucasgelfond•33m ago•0 comments