You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapters/ch00-nodejs-faster-than-you-think.md
+4-6
Original file line number
Diff line number
Diff line change
@@ -524,15 +524,13 @@ This is due to 3 separate processes consuming the memory - One master node, and
524
524
525
525

526
526
527
-
## Final verdict
527
+
## Final Verdict
528
528
529
-
If you need speed - for both - CPU and IO/resourceintensive tasks, you're better off working with languages like Rust, GoLang, C++ (Drogon) or Zig directly. Node.js is perfect for demanding IO workloads and is not slow at all. We just saw, how a small, immature web framework, almost achieved the same speed of Bun, that claimed to be orders of magnitude faster than Node.js counterparts. Stop looking at benchmarks. They're hardly a valid reason to choose a particular tool.
529
+
If you require high performance for both CPU and IO/resource-intensive tasks, languages like Rust, GoLang, C++ (with Drogon), or Zig are more suitable. Node.js excels in handling demanding IO workloads and is far from slow. We observed how a relatively new web framework nearly matched the speed of Bun, which claimed to be significantly faster than Node.js alternatives. Benchmarks should not be the sole factor in choosing a tool.
530
530
531
-
The things that's important is - the tooling, the community, library ecosystem, job market and the list goes on. Node.js can be thought of as #1 on this list as far as serverside programming is concerned. Axum is my go-to framework if I want to build something which involves security heavy things like managing a wallet system, or sub microsecond latency - and that's it.
531
+
What truly matters are the tooling, community, library ecosystem, job market, and other factors. In terms of server-side programming, Node.js can be considered a top choice. For projects requiring high security, such as managing a wallet system or achieving sub-microsecond latency, Axum is my preferred framework.
532
532
533
-
On the other hand, you can work both on server and client applications by knowing just one language. This is the most under-rated part of working with Node.js.
534
-
535
-
Node.js does use a threadpool internally, through **libuv**. Libuv is the underlying C library that powers Node.js's event loop and non-blocking I/O operations. The use of a thread pool in Node.js is primarily for tasks that are not suitable for non-blocking, asynchronous processing. These tasks include, but are not limited to, file I/O, DNS queries, and certain types of network operations.
533
+
Additionally, with Node.js, you can work on both server and client applications using a single language, which is an often-overlooked advantage.
Copy file name to clipboardExpand all lines: chapters/ch06.1-basic-router-implementation.md
+1-9
Original file line number
Diff line number
Diff line change
@@ -143,17 +143,9 @@ We are using the `data` variable to keep track of the content that will be sent
143
143
144
144
The same applies to other routes as well, where we change the data being sent, the status code, and the `My-Header` header according to the `method` and the `url`. If it doesn't matches our needs, we're simply sending a `404` status code, and `Not Found` back to the client.
145
145
146
-
<<<<<<< HEAD
147
-
148
146
> Sending the right headers is really important when sending data back to the client. Headers control how the client and server communicate and protect the data. If the headers are wrong or missing, bad things can happen like security problems or the application not working. So, getting the headers right is more important than the actual data being sent.
149
147
>
150
-
> # In fact you can just ignore the data, and just send an empty response with 404 status code. Every developer knows what does a `404` code means.
151
-
>
152
-
> Sending the right headers is really important when sending data back to the client. Headers control how the client and server communicate and protect the data. If the headers are wrong or missing, bad things can happen like security problems or application malfunctions. So, getting the headers right is more important than the actual data being sent.
153
-
>
154
-
> In fact you can just ignore the data, and just send an empty response with 404 status code. Every developer knows what a `404` code means.
0 commit comments