Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Node.js High Performance

You're reading from   Node.js High Performance Take your application to the next level of high performance using the extensive capabilities of Node.js

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher
ISBN-13 9781785286148
Length 136 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Diogo Resende Diogo Resende
Author Profile Icon Diogo Resende
Diogo Resende
Arrow right icon
View More author details
Toc

The I/O library

The library used by Node.js to be able to perform asynchronous I/O operations across multiple platform environments is libuv. This is an open source library. Actually, It is used by platforms to provide similar functionality to other languages such as Luvit and Lua. Libuv is a cross-platform library that uses the best possible methods for each platform to achieve the best I/O performance and still exposes a common API.

This library is responsible for network tasks (TCP and UDP sockets), DNS requests, filesystem operations, and much more. It's the library that accesses files, lists directory contents, listens for socket connections, and executes child processes. The following image shows how Node.js uses V8 and libuv at the same level:

The I/O library

You can see that libuv does not depend on V8 to interact with I/O. It's a C library with its own thread pool. This thread pool is designed to be fast and avoid creating and destroying task threads too often, as they're very expensive...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image