DEV Community

Cover image for 4 Tiny Mistakes That Secretly Destroy App Performance

4 Tiny Mistakes That Secretly Destroy App Performance

Sylwia Laskowska on May 14, 2026

Ok, I’m back from my short vacation and returning with some useful content πŸ˜„ As you know, from time to time I write posts for you in the style of a...
Collapse
 
pengeszikra profile image
Peter Vivo • Edited

Sylwia you always found some really interesting point like now a custom header, congratulation I never know that is exsist.

I did the file splitting in my - no framework - solution, thanks for the build, tailwind and the minimal rective code size, split a program to independent html pages.

> pnpm build

dist/registerSW.js                               0.13 kB
dist/manifest.webmanifest                        0.36 kB
dist/assets/manifest-B2xQAFIn.json               0.58 kB β”‚ gzip: 0.26 kB
dist/credit.html                                 0.99 kB β”‚ gzip: 0.46 kB
dist/adventure.html                              0.99 kB β”‚ gzip: 0.46 kB
dist/library.html                                1.01 kB β”‚ gzip: 0.47 kB
dist/ship.html                                   1.03 kB β”‚ gzip: 0.51 kB
dist/card.html                                   1.03 kB β”‚ gzip: 0.49 kB
dist/fit.html                                    1.14 kB β”‚ gzip: 0.61 kB
dist/work.html                                   1.28 kB β”‚ gzip: 0.55 kB
dist/mine.html                                   1.34 kB β”‚ gzip: 0.62 kB
dist/story.html                                  1.36 kB β”‚ gzip: 0.63 kB
dist/index.html                                  1.38 kB β”‚ gzip: 0.68 kB
dist/deal.html                                   1.63 kB β”‚ gzip: 0.70 kB
dist/marker.html                                 2.01 kB β”‚ gzip: 0.86 kB
dist/travel.html                                 2.03 kB β”‚ gzip: 0.85 kB
dist/__index.html                                2.10 kB β”‚ gzip: 0.91 kB
dist/throw.html                                  6.14 kB β”‚ gzip: 1.81 kB
dist/assets/style-5bcm0AOV.css                  19.64 kB β”‚ gzip: 4.44 kB
dist/assets/marker-a3K9PoX8.css                 20.43 kB β”‚ gzip: 4.75 kB
dist/assets/ui-elements-C42piOfa.js              0.52 kB β”‚ gzip: 0.20 kB
dist/assets/old-bird-soft-Cet9K-fd.js            0.64 kB β”‚ gzip: 0.40 kB
dist/assets/targetSystem-C6rfYONd.js             0.70 kB β”‚ gzip: 0.17 kB
dist/assets/index-DPcikNFZ.js                    0.70 kB β”‚ gzip: 0.47 kB
dist/assets/modulepreload-polyfill-B5Qt9EMX.js   0.71 kB β”‚ gzip: 0.40 kB
dist/assets/story-BYdjpAbD.js                    0.71 kB β”‚ gzip: 0.50 kB
dist/assets/credit-B_lCQp87.js                   0.92 kB β”‚ gzip: 0.58 kB
dist/assets/shoot-9YV2jSCs.js                    1.11 kB β”‚ gzip: 0.20 kB
dist/assets/work-AxYhedTL.js                     1.24 kB β”‚ gzip: 0.59 kB
dist/assets/adventure-mfPAHVPp.js                1.26 kB β”‚ gzip: 0.74 kB
dist/assets/fencer-CBOzlVSn.js                   1.51 kB β”‚ gzip: 0.76 kB
dist/assets/ship-DzKwFTHn.js                     1.57 kB β”‚ gzip: 0.79 kB
dist/assets/library-iOGeQgd2.js                  1.69 kB β”‚ gzip: 0.87 kB
dist/assets/concept-1YqRBMyf.js                  1.70 kB β”‚ gzip: 0.84 kB
dist/assets/travel-BjKxB5xP.js                   1.70 kB β”‚ gzip: 0.84 kB
dist/assets/GalaxyRoute-Czkip2Wg.js              1.77 kB β”‚ gzip: 0.85 kB
dist/assets/asset-DRNybFKp.js                    2.01 kB β”‚ gzip: 0.50 kB
dist/assets/card-BxPOIcVT.js                     3.05 kB β”‚ gzip: 1.03 kB
dist/assets/mine-txzynpoG.js                     3.08 kB β”‚ gzip: 1.33 kB
dist/assets/marker-CDmeMeHZ.js                   3.08 kB β”‚ gzip: 1.43 kB
dist/assets/throw-CtACwOyr.js                    7.86 kB β”‚ gzip: 2.68 kB
dist/assets/deal-ptFW1zND.js                    10.26 kB β”‚ gzip: 3.93 kB
βœ“ built in 1.16s

PWA v0.21.1
mode      generateSW
precache  41 entries (110.77 KiB)
Enter fullscreen mode Exit fullscreen mode
Collapse
 
sylwia-lask profile image
Sylwia Laskowska

This is actually a beautiful example that you can still achieve a very elegant bundle structure even without a framework πŸ˜„ Those sizes look really nice.

And yeah, the preflight/CORS behavior is one of those things that surprisingly many developers never really hear about in detail. I honestly feel like it’s discussed way too rarely, and the comments under this post kind of confirm that πŸ˜€

Collapse
 
dev_in_the_house profile image
Devin

Definitely

Collapse
 
pascal_cescato_692b7a8a20 profile image
Pascal CESCATO

Great advice, as always! And this is something nobody thinks about: performance isn't just about well-structured code and optimized SQL queries, but also about best practices that we all tend to forget. I try to apply the principles you mention, and generally, my sites have Lighthouse scores above 90. And yet, guess what: I still sometimes forget to optimize the size and file size of an image, or to defer the loading of a script or a font…

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thanks, Pascal πŸ˜„ Oh yes, images were often one of the last things I optimized too πŸ˜€

Although a few years ago I worked on an app that had to function both in Western Europe and somewhere in the middle of Africa, sometimes in libraries with extremely poor internet connections. That project really trained me hard in these kinds of performance issues πŸ˜…

Collapse
 
moopet profile image
Ben Sinclair

Sometimes the fastest image is simply… no image

I think this covers 99% of everything. The problems with deciding whether to split your giant JS bundle go away if you don't use it, because unless you're writing a DAW or an office suite or something, you're almost certainly solving problems that don't exist.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

There’s definitely some truth to that πŸ˜„ Thankfully, it does feel like the industry is slowly moving back toward minimalism again.

And honestly, loading giant fancy images everywhere is often pretty absurd nowadays πŸ˜€ The early-2000s β€œevery website must look like a movie intro” era should probably stay in the past πŸ˜…

Collapse
 
netnavi profile image
Ahmad Firdaus

I only read the first two mistakes mentioned; I know i don't need to read the rest. I've messed up. Custom headers are often used in developer mode to bypass CROSS, but are often forgotten to be properly set up on the move. Once I write a function that calls auth for the whole apps, and when it called it runs the other function in the background with the idea it will be ready anytime i want. But the startup is as slow as a snail.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Exactly πŸ˜„ Sometimes it’s just one tiny thing somebody added, forgot about, or β€œtemporarily” hacked together… and suddenly the whole app feels weirdly slow πŸ˜€

And then the entire team spends days staring at the network tab wondering what on earth is going on πŸ˜…

Collapse
 
netnavi profile image
Ahmad Firdaus

and right now... vibe coding makes it worse... I mean, i join one volunteer project, many are students, and many just use full AI from drafting to deployment using agent, and when some thing wrong... you know that it is like finding a nail in a haystsack.

Thread Thread
 
sylwia-lask profile image
Sylwia Laskowska

Yeah, exactly πŸ˜… And it becomes even worse when people don’t really have the theoretical foundations yet, because then debugging turns into absolute chaos.

If you fully rely on agents from drafting to deployment, but don’t really understand what’s happening underneath, performance issues become a complete nightmare to untangle πŸ˜€

Collapse
 
edmundsparrow profile image
Ekong Ikpe • Edited

Performance must be a top-tier checklist item for any eco-conscious developer. Every kilobyte saved in a bundle and every millisecond saved in execution is energy that isn't being wasted.

"Sometimes the fastest image is simply… no image πŸ˜€"

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

I really love this perspective πŸ™‚ Exactly, performance isn’t only about happier users or better business metrics. It’s also about efficiency and avoiding unnecessary waste. Every oversized bundle, unnecessary request, or giant image means extra energy consumption somewhere in the chain. And when millions of users open an app, those β€œtiny” decisions suddenly stop being tiny!

Collapse
 
leob profile image
leob • Edited

"OPTIONS requests appearing before almost every API call" - I noticed that in a project of mine, and then we decided (in the end) to simply host the API and the "app" (SPA) on the same subdomain - meaning, no CORS ...

But reading your article makes me think it might actually have been solvable with CORS (so with the two separate subdomains) ...

P.S. if it's because of a "custom header" (but what exactly is that?) then it might have had something to do with the AWS environment we were running in (Cloudfront etc) and maybe there wasn't much we could do ...

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Yeah, in your case moving everything under the same origin may honestly have been the safest and simplest solution.

And by β€œcustom header” I mean headers we add ourselves in the frontend, often globally in some interceptor, things like X-Feature-Flag, X-Client-Version, X-Debug, etc. Those can trigger preflight requests even for normal GET calls.

But to be fair, preflights can also happen because of things like Authorization headers, PUT/PATCH/DELETE methods, or even application/json, so depending on your setup there may indeed not have been much you could realistically avoid πŸ™‚

Collapse
 
leob profile image
leob • Edited

Thanks! That more or less confirms what I thought (well, based on what you explained in the article) - we do indeed have those auth headers, and probably some other ones as well, so there might indeed not be that much we could do ...

Our backend was/is hosted in the US (East coast), and I'm located somewhere half around the globe, and I could REALLY notice an annoying amount of latency in UI responses and API requests - so then I started checking the network tab, and saw those pre-flight requests ...

In the end, apart from getting rid of CORS, we optimized a lot of other things, almost eliminating all of that lag - so that made the difference between an "annoying" UX and a fairly pleasant one ...

Thread Thread
 
sylwia-lask profile image
Sylwia Laskowska

Yeah, that’s exactly how it usually goes πŸ˜„ At first it’s very easy to blame β€œthe network” or β€œthe backend,” but once you start digging into the details, all kinds of weird little things suddenly appear.

And honestly, I think this is also why AI probably won’t replace us that quickly πŸ˜€ Real-world performance issues are often this messy mix of infrastructure, browser behavior, historical decisions, accidental complexity, and random enterprise archaeology πŸ˜„

Hopefully we survive until retirement πŸ˜‚

Thread Thread
 
leob profile image
leob • Edited

Yes, we will survive! Isn't that the title of a famous song? No, it's "I will survive"! :-)

Thread Thread
 
sylwia-lask profile image
Sylwia Laskowska

Hahahaha this just reminded me of a story πŸ˜„ A Polish couple I know once wanted to use β€œI Will Survive” as their first dance song at their wedding xDDDD

When I explained to them that the song is literally about a breakup, they suddenly looked very concerned and decided to search for another one instead πŸ˜€

Collapse
 
gnomeman4201 profile image
GnomeMan4201

Less is more sometimes. This is a good reminder that performance problems usually don’t start as huge failures, they stack up from tiny choices.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Exactly πŸ˜„ One small mistake here, one tiny oversight there… and suddenly the whole application starts feeling sluggish πŸ˜€

Collapse
 
adamthedeveloper profile image
Adam - The Developer • Edited

Welcome back home @sylwia-lask

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Hahaha thanks πŸ˜„ I missed you guys too πŸ™‚

Collapse
 
gramli profile image
Daniel Balcarek

These are really nice tips for improving performance quickly and without huge effort πŸ‘

I usually put code quality and readability before raw performance. Highly optimized code is great, but if the team is afraid to touch it because nobody fully understands it, that’s a highway to hell. So the code splitting example sounds way too familiar to me, but shh πŸ˜„

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Oh, absolutely πŸ˜„ Premature optimization can become a complete nightmare for maintainability. And honestly, on the frontend, good practices plus modern ESNext/browser features already solve a huge amount of problems.

Also… the β€œtheoretical code splitting” situation is incredibly common πŸ˜„

Collapse
 
anna2612 profile image
Anna Jambhulkar

This is a really practical breakdown.

The β€œdeath by a thousand cuts” point is exactly how many production problems actually happen. One old custom header, one shared module that quietly pulls half the app, one unnecessary dependency, one huge hero image β€” none of them looks catastrophic alone, but together they shape the user experience.

I’m seeing a similar pattern while building NEES Core Engine, but on the AI runtime side. Small unmanaged choices around context, memory, tools, fallbacks, and traceability don’t look dangerous individually, but over time they turn into reliability problems in production AI products.

For frontend performance, we use network tabs, bundle analyzers, and real-device testing. For AI products, I think we need the same mindset: runtime visibility, governance, and traceability around what actually happens after deployment.

Great article β€” very practical and grounded.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thanks for this comment. Honestly, this is such a great contribution to the discussion!

And I think you’re absolutely right. AI products already have β€” or soon will have β€” very similar kinds of problems. Different technology, but the same β€œdeath by a thousand cuts” effect caused by lots of tiny unmanaged decisions.

Which is honestly kind of fascinating πŸ˜€ We move forward technologically, but a lot of the old engineering knowledge still turns out to be extremely useful in these new environments too πŸ™‚

Collapse
 
anna2612 profile image
Anna Jambhulkar

Thank you β€” I really liked the way you framed the original post.

That β€œdeath by a thousand cuts” pattern is exactly what I think AI products are starting to face too.

In normal apps, tiny unmanaged decisions can slowly damage performance, reliability, and user experience.

In AI products, the same thing can happen through:

  • small prompt changes
  • unclear memory usage
  • inconsistent role behavior
  • missing escalation rules
  • weak traceability
  • tiny workflow exceptions that nobody documents

Individually, each issue looks minor. But together, they create drift, unpredictability, and trust problems.

That is why I think a lot of old engineering lessons still matter in AI systems. Observability, boundaries, reviewability, and clear contracts are becoming just as important as model quality.

Different technology, same engineering truth: small unmanaged decisions eventually become system-level failures.

Collapse
 
innovationsiyu profile image
Siyu

The custom headers triggering OPTIONS preflight requests is a detail I had completely overlooked, and it explains a lot about the latency I have been seeing. Your point about lazy loading being defeated by a bloated shared module hit home, since our codebase likely has the exact same trap. I need to stop assuming tree shaking will automatically save us from importing entire libraries. That oversized hero image silently killing LCP is another mistake I am probably guilty of.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Hahaha honestly, I think every developer who actually ships real applications has been guilty of at least one performance disaster πŸ˜„ Probably the only people who never make these mistakes are the ones who never build anything πŸ˜€

Collapse
 
printo_tom profile image
Printo Tom

Love this breakdown β€” it’s the perfect reminder that performance issues are rarely one giant bug, but rather a pile of β€œtiny cuts” that add up.

The preflight request example especially hits home. I’ve seen teams chasing backend latency for weeks only to discover it was an immortal custom header triggering OPTIONS calls. Same story with code splitting β€” looks great in theory, but if everything funnels through a bloated shared module, you’re just shipping one giant bundle in disguise.

Your point on dependencies is gold too. I once audited a React app that had three different date libraries plus Lodash imported wholesale. The bundle was basically a museum of developer preferences.

And the background image example is the classic β€œworks fine on my machine” trap. On a fiber connection it’s invisible, but on a cheap Android over 3G it’s the difference between usable and abandoned.

The way you framed it β€” death by a thousand cuts β€” is exactly right. Individually harmless, collectively devastating. Thanks for surfacing these; they’re the kind of practical lessons that save real users pain.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thank you so much for this comment πŸ˜„ And honestly, I think it perfectly shows how incredibly common these problems really are.

Almost every larger application seems to accumulate some combination of β€œimmortal” headers, giant shared modules, forgotten dependencies, or oversized assets over time πŸ˜€

Collapse
 
buildbasekit profile image
buildbasekit

Performance bugs are basically archaeological artifacts. You remove one random X-Legacy-Feature-Flag header and suddenly Lighthouse goes from β€˜needs improvement’ to β€˜who touched production?’ πŸ˜„

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Hahahaha exactly πŸ˜„ It’s the same with code splitting sometimes. Suddenly the app loads way faster and everybody starts asking: β€œWait… are we sure something isn’t missing?” πŸ˜€

Collapse
 
buildbasekit profile image
buildbasekit

That’s the universal performance optimization panic πŸ˜„

β€œApp is 40% faster now.”

β€œGreat.”

β€œβ€¦but what did we accidentally break?” πŸ˜‚

Thread Thread
 
sylwia-lask profile image
Sylwia Laskowska

Hahaha 100% πŸ˜„ And the worst part is when something suddenly starts working β€œby itself” after the optimization πŸ˜€

Collapse
 
iampraveen profile image
Praveen Rajamani

Great breakdown .! The death by a thousand cuts analogy is spot on - individually, these seem harmless, but together they can make an app feel terrible on real-world devices.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Exactly πŸ˜„ There’s rarely a single silver bullet in performance work, you usually have to dig into lots of tiny details.

And honestly, this isn’t only about user satisfaction anymore. Performance is also a form of accessibility. Not everybody has a powerful laptop, fast internet, or a modern phone πŸ™‚

Collapse
 
kenwalger profile image
Ken W Alger

This is such a sharp, practical list. It’s easy to focus on the 'big' architectural decisions and completely overlook how quickly these 'tiny' mistakes compound into a sluggish user experience.

Your points on image optimization and excessive re-renders hit home particularly hard. I’m reminded of a conference talk I gave where I accidentally included a few of these mistakes in a single demo. It ran like a dream on my local machine, but the moment I hit the conference Wi-Fi, the app basically turned into a very expensive slideshow.

There’s nothing like 'real-world' latency to turn a developer’s 'minor oversight' into a performance post-mortem! Thanks for the great reminders to keep us honest.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thanks so much for the great comment πŸ˜„ And ohhh yes, conference Wi-Fi is always an adventure πŸ˜€

I totally relate to that fear. Before my last conference talk, I literally added service workers to everything the day before and ended up running the demo remotely/offline-ready just to save myself from disaster πŸ˜… It absolutely saved my ass in the end πŸ˜€

Collapse
 
syedahmershah profile image
Syed Ahmer Shah • Edited

Your posts always amaze me β™₯️

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

AWWW thank you so much β€οΈπŸ˜„

Collapse
 
nk2552003 profile image
Nitish

Reading this felt way too relatable πŸ˜…
Sometimes in tech and honestly in life too, it’s never one huge mistake, but hundreds of small ignored things that slowly create bigger problems over time.
Really loved how this article turns simple performance lessons into something every developer can connect with personally

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Thank you πŸ˜„ And honestly, that’s exactly why I wanted to write it this way. Performance problems are often very technical… but the pattern behind them feels surprisingly universal πŸ˜€

Collapse
 
harsh2644 profile image
Harsh

I've definitely been guilty of at least one of these πŸ˜…

The one that hit closest was #2 I spent an embarrassing amount of time debugging a slow list component last month Turned out I was missing a proper key Two hours Because of one line

That's the thing about tiny mistakes They're tiny to write They're not tiny to debug.

Thanks for the checklist bookmarking this for the next time I wonder why is this slow?πŸ™Œ

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Hahahaha exactly πŸ˜„ Honestly, two hours is still pretty good πŸ˜€ Sometimes people spend weeks trying to figure out why something feels slow.

And that’s what makes performance issues so tricky. The actual mistake is often tiny, but the debugging journey absolutely isn’t πŸ˜… Thanks for the great comment!!!

Collapse
 
m_saad_ahmad profile image
M Saad Ahmad

Wow, a blast of knowledge this was for me.

I've always had a strong focus on images, and I've definitely experienced the frustration of images loading slowly on e-commerce and government websites.

In one of my projects (which I've since abandoned πŸ˜…), I learned heavily about the importance of effective image loading. Using formats like WebP and AVIF really helps reduce image sizes while ensuring the quality remains intact.

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Hahaha, I worked with WordPress sites a long time ago, so I was basically trained in image optimization by force πŸ˜„

And yes, WebP and AVIF can make such a huge difference, especially on image-heavy websites πŸ™‚

Collapse
 
kollittle profile image
kol kol

This is one of those posts that should be bookmarked. The practical examples really help bridge the gap between 'I know the syntax' and 'I can use this in production.'