Article

My React App Was Slow... The Reason Shocked Me đŸ€Ż

Abhijeet Kakade
Abhijeet Kakade
2026-02-18 5 min read

Why Was My Frontend So Slow?

So recently my frontend started feeling very slow.

At first, I thought:

  • Maybe React needs time to compile.
  • Maybe my laptop is slow.
  • Maybe it’s a network issue.
  • Maybe it’s just my ASUS TUF acting like a jet engine again.

Clicking on any component felt delayed.
Everything responded
 but with lag.

For days, I didn’t investigate properly.
I just frustrated myself and blamed the frontend.

And for days I tried to fix it.

Tried many things.
Asked every AI I knew.
Went to Stack Overflow, Reddit, GitHub, YouTube searching for answers like I was trying to find the Infinity Stones.

I never even looked at the backend.


The Real Culprit

Later, while debugging something unrelated in the backend, I noticed something interesting.

There were too many console logs.

They were added for debugging purposes. Harmless, right?

Not exactly.

cron.schedule('* * * * *', async () => {
  const users = await User.find({}); // Fetching ALL users 

  users.forEach(user => {
    console.log(`Checking user ${user.id}`); 
    console.log(`Processing subscription for ${user.email}`); 
    console.log(`Status: ${user.status}`);
    
    // ... logic ...
  });
});

(The above code is just an example)

There was a cron job running in the background that scanned the entire database to check subscription expiries.

When that cron job ran:

  • It logged heavily.
  • It occupied the thread.
  • Other incoming requests had to wait.
  • The frontend requests got delayed.

And suddenly


The “slow React frontend” mystery was solved.

  • It wasn’t React.
  • It wasn’t my laptop.
  • It wasn’t the network.

It was excessive logging + blocking backend work.

Lesson Learned

The thing that helps you debug in development can hurt you in production.

Heavy console logging inside long running jobs can:

  • Slow down request handling
  • Block threads
  • Increase response times
  • Make the frontend look broken

Now I’m way more careful about:

  • Logging levels
  • Cron job design
  • Async handling
  • Production logging strategy

Sometimes the frontend isn’t slow.

It’s just waiting for the backend to breathe.