Some misconceptions Nodejs is single threaded: Yes and No. Yes when you think of Event loop, V8 and No when you’re think of a thread pool.. The javascript code i.e. execution context is single threaded. So if you block by running some js intensive operation it might block the event loop. Nodejs used thread pool for… Continue reading Debunking Common NodeJS Misconceptions
Tag: javascript
Async IO in NodeJS
Deep dive in Nodejs Internals (Blocking, Non-blocking IO, select/poll/epoll, event loop) We all know by now that Nodejs scales, but why & how? is the question asked by many to no satisfactory answer as there is a lack of satisfactory answers as most of the content available online does not cover the internal workings and provides… Continue reading Async IO in NodeJS
Clustering and PM2: Multitasking in NodeJS
Deep Dive in Cluster and PM2 What & Why is Clustering was needed? We are well aware that NodeJS is not specifically built for CPU-intensive tasks because of its single-threaded architecture. However, this doesn’t mean that we can’t make use of it for such tasks. In fact, NodeJS offers a couple of options to handle… Continue reading Clustering and PM2: Multitasking in NodeJS
Child Processes: Multitasking in NodeJS
Deep Dive in Child Processes, Spawn, Exec, ExecFile, Fork, IPC What exactly Child Processes are then? When you run the NodeJS application it’ll have its own process just like any other application you run, may it be VS Code, VLC Player etc. The properties of this process is available on Global object’s process variable that we can… Continue reading Child Processes: Multitasking in NodeJS
Worker Threads : Multitasking in NodeJS
Deep Dive into Worker threads Why do we need worker threads at all? A server can quickly become overwhelmed by a CPU-intensive workload. To illustrate, imagine you have two endpoints: one performs a simple, non-CPU intensive task, while the other handles a complex CPU-intensive operation that takes 10 seconds to complete. If your server is… Continue reading Worker Threads : Multitasking in NodeJS
Intro to multithreaded JavaScript
Escape the single-threaded event loop in browsers and on the server. Here’s how to use worker threads and web workers for modern multithreading in JavaScript. The JavaScript language is one of the wonders of the software world. It is incredibly powerful, flexible, and versatile. One limitation of its fundamental design, however, is its single-threaded nature. Traditional JavaScript appears to handle… Continue reading Intro to multithreaded JavaScript
Understanding Immutability in JavaScript
If you haven’t worked with immutability in JavaScript before, you might find it easy to confuse it with assigning a variable to a new value, or reassignment. While it’s possible to reassign variables and values declared using let or var, you’ll begin to run into issues when you try that with const. Say we assign… Continue reading Understanding Immutability in JavaScript
JavaScript Libraries for AI Engineering
Traditionally known for its role in web development, JavaScript has — much to the surprise of many — also proven invaluable in developing applications that use large language models (LLMs). In this article, we’ll explore five leading tools for AI engineering, highlighting some essential resources for developers wanting to incorporate LLMs into their projects. We’ve chosen them… Continue reading JavaScript Libraries for AI Engineering
Function Composition in JavaScript
Function composition is the pointwise application of one function to the result of another. Developers do it in a manual manner every day when they nest functions: compose = (fn1, fn2) => value => fn2(fn1(value)) But this is hard to read. There is a better way using function composition. Instead of reading them from inside… Continue reading Function Composition in JavaScript
DRACOLoader
Draco is an open source library for compressing and decompressing 3D meshes and point clouds. Compressed geometry can be significantly smaller, at the cost of additional decoding time on the client device. A normal glTF file can be converted to a Draco-compressed glTF file using glTF-Pipeline. When using Draco with glTF, an instance of DRACOLoader will be… Continue reading DRACOLoader