File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- var sys = require ( "../lib/sys" ) ;
1+ var sys = require ( "sys" ) ,
2+ childProcess = require ( "child_process" ) ;
23
34function next ( i ) {
45 if ( i <= 0 ) return ;
56
6- var child = process . createChildProcess ( "echo" , [ "hello" ] ) ;
7+ var child = childProcess . spawn ( "echo" , [ "hello" ] ) ;
78
8- child . addListener ( "output " , function ( chunk ) {
9- if ( chunk ) sys . print ( chunk ) ;
9+ child . stdout . addListener ( "data " , function ( chunk ) {
10+ sys . print ( chunk ) ;
1011 } ) ;
1112
1213 child . addListener ( "exit" , function ( code ) {
Original file line number Diff line number Diff line change 11var path = require ( "path" ) ;
2- var sys = require ( "../lib/ sys" ) ;
3- var benchmarks = [ "static_http_server.js"
4- , "timers.js"
2+ var sys = require ( "sys" ) ;
3+ var childProcess = require ( "child_process" ) ;
4+ var benchmarks = [ "timers.js"
55 , "process_loop.js"
6+ , "static_http_server.js"
67 ] ;
78
89var benchmarkDir = path . dirname ( __filename ) ;
910
1011function exec ( script , callback ) {
1112 var start = new Date ( ) ;
12- var child = process . createChildProcess ( process . ARGV [ 0 ] , [ path . join ( benchmarkDir , script ) ] ) ;
13+ var child = childProcess . spawn ( process . argv [ 0 ] , [ path . join ( benchmarkDir , script ) ] ) ;
1314 child . addListener ( "exit" , function ( code ) {
1415 var elapsed = new Date ( ) - start ;
1516 callback ( elapsed , code ) ;
Original file line number Diff line number Diff line change 1- var http = require ( "../lib/ http" ) ;
1+ var http = require ( "http" ) ;
22
33var concurrency = 30 ;
4- var port = 8000 ;
5- var n = 700 ;
4+ var port = 12346 ;
5+ var n = 7 ; // several orders of magnitude slower
66var bytes = 1024 * 5 ;
77
88var requests = 0 ;
You can’t perform that action at this time.
0 commit comments