Web/Node.js from scratch

lib/internal/timers.js

mayleaf 2022. 5. 20. 01:08

I start to read node.js source code reading.

Today, I opened timers.js in internal directory.

 

What it's comment said

First

To be performant, timers.js optimized to insert, remove, and timeout( handling a timer timing out.)

It trys to keep duration for these operations as be near to constant time.

Second

Read internal/linkedlist.js first.

What I thought

First

As expected, at the low level code of javascript is coated with prototype.<something>

Second

I don't understand full code of this file, actually I catch only a few lines of this code.

But It is critical part of node.js code. 

Third

Memo: Read.. the internal/linkedlist.js...

Fourth

What is the primodials? All important symbols are allocated by destructural assignment with the "primorials"

I should follow them