DEV Community

Easy Tuts
Easy Tuts

Posted on

2

Concurrency vs Parallelism

Concurrency:

Think of concurrency like juggling different tasks, but you're only actually handling one at a time. It's all about managing multiple things efficiently.

Example:
Imagine a student doing homework. They have math, science, and English assignments. Instead of finishing one completely before starting the next, they might:

  • Work on math for 10 minutes,
  • Take a break and switch to science for 10 minutes,
  • Then switch to English for 10 minutes.

You're making progress on all three subjects, but you're not literally doing them at the exact same moment. It's like you're bouncing between tasks, keeping them all moving forward.

Parallelism:

Now, parallelism is when you're actually doing multiple things at the exact same time. This usually needs multiple people or machines to pull off.

Example:
Imagine you and your friends are working on a group project:

  • You're writing the intro
  • Your buddy's designing a cool poster
  • Another friend is putting together a presentation
  • And someone else is digging up research

In this case, you're all working on different parts of the project at the same exact moment. That's parallelism in action – multiple tasks happening simultaneously.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

The best way to debug slow web pages cover image

The best way to debug slow web pages

Tools like Page Speed Insights and Google Lighthouse are great for providing advice for front end performance issues. But what these tools can’t do, is evaluate performance across your entire stack of distributed services and applications.

Watch video

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay