<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/day-24-30-profile-before-optimising-pun5mdgrz" -->

---
title: Day 24/30 — Profile Before Optimising | daily.dev
description: Performance tuning should start with measurement, not assumptions. Key metrics to gather before optimizing include p50/p95 latency, database query duration and...
canonical: https://daily.dev/posts/day-24-30-profile-before-optimising-pun5mdgrz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Day 24/30 — Profile Before Optimising | daily.dev
og:description: Performance tuning should start with measurement, not assumptions. Key metrics to gather before optimizing include p50/p95 latency, database query duration and...
og:url: https://daily.dev/posts/day-24-30-profile-before-optimising-pun5mdgrz
og:image: https://api.daily.dev/og/posts/pun5MDgRz.png
og:image:alt: Day 24/30 — Profile Before Optimising
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Day 24/30 — Profile Before Optimising

**[Nestjs Developers](https://daily.dev/sources/nestjsdevs)** · [@ezilemdodana](https://daily.dev/ezilemdodana) · 1 min read · 38 upvotes · 7 comments

## Summary

Performance tuning should start with measurement, not assumptions. Key metrics to gather before optimizing include p50/p95 latency, database query duration and count, external API call time, CPU and memory usage, event-loop delay, and trace spans. Bottlenecks are often a missing index, an oversized response, or a slow external call rather than the framework itself. The post stresses that optimizing without a baseline is guesswork, and without a follow-up measurement it's just storytelling.

## Content

Do not optimise the code that looks slow.

Measure the request that is slow.

Start with:

- p50 and p95 latency
- Database query duration and count
- External API time
- CPU and memory
- Event-loop delay
- Trace spans

The bottleneck is often one missing index, one oversized response or one external call, not NestJS itself.

Performance work without a baseline is guesswork.

Performance work without a second measurement is storytelling.

What was your most surprising performance bottleneck?

![nest24.png](https://media.daily.dev/image/upload/s--iB-0dkU1--/f_auto/v1787736373/ugc/content_1be87fa8-2daa-4dcd-8b73-c2d7dd7bbb6d?_a=BAMAMicg0)

#NestJS #Performance #Observability

## Community discussion

Top comments from developers on daily.dev.

**@agustinbarrientos** · 2 upvotes

> Teams should add event-loop utilization and queue depth beside delay, because a healthy p95 can hide a service that is almost out of headroom. The second measurement should run under the same traffic shape and data volume as the baseline.

**@matchpoint** · 1 upvotes

> ![GIF](https://static.klipy.com/ii/4e7bea9f7a3371424e6c16ebc93252fe/74/4d/gJHtfOzFCh7jrmw1PLE.gif)

**@bob72** · 1 upvotes

> What are you measuring p50 for?

**@navyaak** · 1 upvotes

> ![GIF](https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/7e/11/oCtGUhKV.gif)

**@gyan\_kr** · 0 upvotes

> for those who don't know that p{x} things: [https://www.linkedin.com/pulse/understanding-p50-p75-p90-p95-p99-latency-metrics-rizwan-ahmed-osoqc/](https://www.linkedin.com/pulse/understanding-p50-p75-p90-p95-p99-latency-metrics-rizwan-ahmed-osoqc/)

## Similar posts on daily.dev

- [How to Write High-Performance Code](https://daily.dev/posts/how-to-write-high-performance-code-1e303rwjv) · ByteByteGo · 14 upvotes · 0 comments
- [Performance Hints](https://daily.dev/posts/performance-hints-eqeu2vzz8) · Hacker News · 0 upvotes · 0 comments
- [Insights from 100 site speed reviews in 2025](https://daily.dev/posts/insights-from-100-site-speed-reviews-in-2025-yh4tk3cne) · Web Performance Calendar · 0 upvotes · 0 comments
- [Performance engineering from kernel analysis to AI: Adrian Cockcroft’s take](https://daily.dev/posts/performance-engineering-from-kernel-analysis-to-ai-adrian-cockcroft-s-take-acpyhmtc4) · The New Stack · 1 upvotes · 0 comments
- [WordPress Speed Optimization Explained Layer by Layer](https://daily.dev/posts/wordpress-speed-optimization-explained-layer-by-layer-h540rtuzr) · ACF · 9 upvotes · 1 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#observability](https://daily.dev/tags/observability), [#nestjs](https://daily.dev/tags/nestjs)

[View this post on daily.dev](https://daily.dev/posts/day-24-30-profile-before-optimising-pun5mdgrz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/day-24-30-profile-before-optimising-pun5mdgrz","headline":"Day 24/30 — Profile Before Optimising","text":"Performance tuning should start with measurement, not assumptions. Key metrics to gather before optimizing include p50/p95 latency, database query duration and count, external API call time, CPU and memory usage, event-loop delay, and trace spans. Bottlenecks are often a missing index, an oversized response, or a slow external call rather than the framework itself. The post stresses that optimizing without a baseline is guesswork, and without a follow-up measurement it's just storytelling.","url":"https://daily.dev/posts/day-24-30-profile-before-optimising-pun5mdgrz","datePublished":"2026-08-26T09:26:19.874Z","dateModified":"2026-09-13T21:21:07.819Z","author":{"@type":"Person","name":"Ezile Mdodana","url":"https://daily.dev/ezilemdodana","image":"https://media.daily.dev/image/upload/s--1OI8gwnO--/f_auto/v1771923757/avatars/avatar_7vB9SeLRKhOHGnzEpmFvQ?_a=BAMAMiiu0","description":"Software Project Lead sharing practical insights on NestJS, Angular, AWS and scalable systems.","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":8430}},"interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":38},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":7}],"comment":[{"@type":"Comment","text":"Teams should add event-loop utilization and queue depth beside delay, because a healthy p95 can hide a service that is almost out of headroom. The second measurement should run under the same traffic shape and data volume as the baseline.","datePublished":"2026-08-26T22:59:02.013Z","url":"https://daily.dev/posts/pun5MDgRz#c-Uiw8pjswK","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"","datePublished":"2026-08-26T12:52:32.469Z","url":"https://daily.dev/posts/pun5MDgRz#c-cIu82Bb9q","author":{"@type":"Person","name":"Numb Code","url":"https://daily.dev/matchpoint","image":"https://lh3.googleusercontent.com/a/ACg8ocJ86YIewk804FajHaEbzIBiQa9RFZVR0fs-vBpSZ3ObyDY6Qz8=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"What are you measuring p50 for?","datePublished":"2026-08-26T21:00:22.428Z","url":"https://daily.dev/posts/pun5MDgRz#c-33NXiVBVb","author":{"@type":"Person","name":"Bob","url":"https://daily.dev/bob72","image":"https://avatars.githubusercontent.com/u/193962566?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"","datePublished":"2026-08-30T16:58:55.719Z","url":"https://daily.dev/posts/pun5MDgRz#c-uCHqBVAwY","author":{"@type":"Person","name":"navya","url":"https://daily.dev/navyaak","image":"https://media.daily.dev/image/upload/s--vM6dTj_h--/f_auto/v1788852968/avatars/avatar_DLRmpRw88MjNBUKqs8T0W?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"for those who don’t know that p{x} things: https://www.linkedin.com/pulse/understanding-p50-p75-p90-p95-p99-latency-metrics-rizwan-ahmed-osoqc/","datePublished":"2026-09-25T07:20:56.421Z","dateModified":"2026-09-25T07:21:06.751Z","url":"https://daily.dev/posts/pun5MDgRz#c-nipGKej0P","author":{"@type":"Person","name":"Gyan Prakash Kumar","url":"https://daily.dev/gyan_kr","image":"https://media.daily.dev/image/upload/s--bEp_keso--/f_auto/v1711995979/avatars/avatar_oM44E2GtuwATV9pMpdFUQ"}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/nestjsdevs","name":"Nestjs Developers"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Nestjs Developers","item":"https://daily.dev/squads/nestjsdevs"},{"@type":"ListItem","position":3,"name":"Day 24/30 — Profile Before Optimising"}]}
```

