public
Created

Fib

  • Download Gist
ApacheBench
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
$ ab -n 4000 -c 100 http://localhost:1337/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
 
Benchmarking localhost (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests
Completed 2000 requests
Completed 2400 requests
Completed 2800 requests
Completed 3200 requests
Completed 3600 requests
Completed 4000 requests
Finished 4000 requests
 
 
Server Software:
Server Hostname: localhost
Server Port: 1337
 
Document Path: /
Document Length: 9 bytes
 
Concurrency Level: 100
Time taken for tests: 0.775 seconds
Complete requests: 4000
Failed requests: 0
Write errors: 0
Total transferred: 292000 bytes
HTML transferred: 36000 bytes
Requests per second: 5159.56 [#/sec] (mean)
Time per request: 19.381 [ms] (mean)
Time per request: 0.194 [ms] (mean, across all concurrent requests)
Transfer rate: 367.82 [Kbytes/sec] received
 
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.5 0 4
Processing: 3 19 8.9 19 45
Waiting: 3 19 8.9 19 45
Total: 3 19 8.9 19 45
 
Percentage of the requests served within a certain time (ms)
50% 19
66% 24
75% 26
80% 28
90% 31
95% 33
98% 36
99% 37
100% 45 (longest request)
app.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
var http = require('http');
 
var fib = {};
function fibonacci(n) {
if(fib[n]) return fib[n];
if (n < 2)
return 1;
else
return fib[n] = fibonacci(n-2) + fibonacci(n-1);
}
 
fibonacci(40);
 
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end("" + fibonacci(40));
}).listen(1337, "127.0.0.1");

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.