FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Performance Testing Fastify App Builds & Database Connections
How-ToSystems

Performance Testing Fastify App Builds & Database Connections

via Dev.toPranavB61mo ago

TLDR; One-line takeaways Supabase vs Local: ~ 57× slower per request (adds ~ 61 ms ). New DB connection each test (Supabase): ~ 6.6× slower than reusing (adds ~ 448 ms ). Build+close app each test: adds about ~19 ms per test (Supabase) and ~16–17 ms per test (local). It all started with one question: When I'm testing my Fastify app, doesn't it cost a lot of performance to build() and close() the app for every test? Especially since I am opening a sql connection every time it builds. So with the help I wrote a test (with the help of AI): describe ( " Fastify app lifecycle perf " , () => { it ( " A) build+close per test " , async () => { const t0 = nowMs (); for ( let i = 0 ; i < 10 ; i ++ ) { const app = await buildTestApp (); const res = await app . inject ({ method : " GET " , url : " /readyz " , }); expect ( res . statusCode ). toBe ( 200 ); await app . close (); } const t1 = nowMs (); console . log ( " A) build+close per test: " , ( t1 - t0 ). toFixed ( 1 ), " ms " ); expect ( true

Continue reading on Dev.to

Opens in a new tab

Read Full Article
31 views

Related Articles

Switzerland — Best Crypto Exchange (2026)
How-To

Switzerland — Best Crypto Exchange (2026)

Dev.to Beginners • 1d ago

Cursor Your Dream, Part 2: How to Move From First Prompt to First Working App
How-To

Cursor Your Dream, Part 2: How to Move From First Prompt to First Working App

Hackernoon • 2d ago

How-To

The Difference between `let`, `var` and `const`

Medium Programming • 2d ago

How-To

Circulation Metrics Framework for Living Systems

Medium Programming • 2d ago

Red Rooms makes online poker as thrilling as its serial killer
How-To

Red Rooms makes online poker as thrilling as its serial killer

The Verge • 2d ago

Discover More Articles