JavaScript at the Same Speed as C

Posted by

JS At The Speed Of C

The Speed of JavaScript Compared to C

JavaScript, often abbreviated as JS, is a popular programming language that is widely used for web development. It is known for its versatility and ease of use, however, it is often criticized for being slower compared to other programming languages such as C. In this article, we will explore the speed of JavaScript compared to C and the various factors that contribute to these differences.

Understanding JavaScript

JavaScript is an interpreted language, meaning that it is executed line by line by a program called an interpreter. This makes it easier to write and debug code, as the programmer does not need to compile the code before running it. However, this also means that JavaScript can be slower than compiled languages like C, which are translated into machine code before being executed.

Comparing JavaScript to C

C is a compiled language, meaning that it is translated into machine code before being executed. This makes C much faster than JavaScript, as the machine code can be executed directly by the computer’s processor, without the need for an interpreter. As a result, C is often used for performance-critical applications such as system software, device drivers, and game development.

Improving JavaScript Performance

Although JavaScript may be slower than C, there are several techniques that can be used to improve its performance. For example, using modern JavaScript engines such as V8, which is used in the popular Chrome browser, can greatly improve the speed of JavaScript code. Additionally, writing efficient and optimized code, using caching and memoization, and minimizing DOM manipulation can also help improve JavaScript performance.

Conclusion

While JavaScript may be slower than compiled languages like C, it is still a powerful and versatile language that is widely used for web development. By understanding the factors that contribute to JavaScript’s speed and implementing best practices for improving performance, developers can ensure that their JavaScript code runs efficiently and effectively.

0 0 votes
Article Rating
38 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@codehunter4072
7 months ago

I have 5 years experience in react native,always argue that RN better than Flutter ,and then i joined a new company and should work in flutter and unity , then its blowed me up, Flutter is better 😂 eventhough the code looks a mess

@GamlaSonn
7 months ago

Cool vid Theo. JavaScript all the things. The idea of fullstack developer will never be the same. Love the idea of faster JS though, I imagine Web Assembly is similar for the web (although perhaps they're not static/AOT compilation)? How much will the web take from this?

@dabmantrips416
7 months ago

The Amazon and Meta dick and balls was top tier 🤣🤣🤣

@Curstantine
7 months ago

The effort that a js dev puts to keep using js is insane.

@RoboticusMusic
7 months ago

Why wouldn't this exist in the first place, coders are silly.

@raddadslab5097
7 months ago

Building desktop apps with JS, and using a library like Sharp for image manipulation!

@Sagora123
7 months ago

man these thumbnails…

@baileyburnsed4352
7 months ago

My first langauge was C/C++ when I was 6. I am used to low level optizations.

@KrakonosovoBabka
7 months ago

"Is it possible to transpile js to static language?" Js wouldn't be able to run if it was not possible. (sorry for capital j in js)

@kennedydre8074
7 months ago

Not gon lie when I saw the title I assumed the C was the speed of light constant 😂💀

@MrZooper
7 months ago

The lengths that people will go to not learn anything but JS, me included

@hydrilara
7 months ago

Javascript is the worst programming language. I hope it was never invented.

@drsensor
7 months ago

I'm curious how it compare with AssemblyScript. I know it target WASM but hey, you can compile module.wasm into C code.

@woofcaptain8212
7 months ago

What if we just didnt use js for backends tho? Or is this some wasm magic that runs in the browser?

@whathappenedman
7 months ago

Is it just me or is it hard to looks that this guys face

@white-bunny
7 months ago

Kind of crazy to think, Amazon helped RN devs in integrating Microsoft's Typescript onto Meta's Software.
Maybe not so much crazy, cuz Typescript itself is crazy good.

@pldcanfly
7 months ago

It just feels strange how much energy and effort people are willing to invest, instead of just using a truly native language. I mean if I can crash the system with JS like i can with c++, i need to be at the same level as the c++ developer. At that point I could just learn the syntax of c++ and be done with it. But! What really excites me is what this can mean for the web in general. When JS gets so performant, that you can realistically program demanding games on it.

@kennylindahl2885
7 months ago

Could it happen for the browser as well in the future?
That would be crazy

@nickr753
7 months ago

It’s pronounced Her-mees, like the Greek god. “Ehr-mehz” is how you pronounce the fashion label.

@voidmind
7 months ago

That sounds like what Chris Lattner is doing with Mojo, to make Python code faster (different approach, but the static typing to make it faster is similar)