[ ] Node.js |
Episode 8: Interview with Ryan Dahl, Creator of Node.js , Node.js, .
(fs.readFileSync ) JS .
JS (, fs.readFile).
Node.js , child_process cluster .
3.3 kB 10 000
Symbol | Name | ops/sec | Percents |
---|---|---|---|
A | Loop readFileSync | 7.4 | 100% |
B | Promise chain readFileSync | 4.47 | 60% |
C | Promise chain readFile | 1.09 | 15% |
D | Promise.all readFileSync | 4.58 | 62% |
E | Promise.all readFile | 1.69 | 23% |
F | Multithread loop readFileSync | 1.35 | 18% |
3.3 kB 100
Symbol | Name | ops/sec | Percents |
---|---|---|---|
A | Loop readFileSync | 747 | 100% |
B | Promise chain readFileSync | 641 | 86% |
C | Promise chain readFile | 120 | 16% |
D | Promise.all readFileSync | 664 | 89% |
E | Promise.all readFile | 238 | 32% |
F | Multithread loop readFileSync | 1.55 | 0.2% |
6.5 MB 100
Symbol | Name | ops/sec | Percents |
---|---|---|---|
A | Loop readFileSync | 0.63 | 83% |
B | Promise chain readFileSync | 0.66 | 87% |
C | Promise chain readFile | 0.61 | 80% |
D | Promise.all readFileSync | 0.66 | 87% |
E | Promise.all readFile | 0.76 | 100% |
F | Multithread loop readFileSync | 0.56 | 74% |
3.3 kB 10 000 ( Multithread loop readFileSync)
6.5 MB 100
fs.readFileSync . fs.readFile , . fs.readFileSync fs.readFile, fs.readFile fs.readFileSync.
, fs.readFileSync, fs.readFile ( ).
fs.readFileSync . . child_process. , , .
.
T1. (P1 P2) ( ). fs.readFileSync 1 :
P1 -> P2
fs.readFile 1 :
P1-1 -> P2-1 -> P1-2 -> P2-2
P1-1, P2-1 , P1-2, P2-2 .
. . , .