benchmarking

Why is Go so slow (compared to Java)?

别来无恙 提交于 2019-12-03 18:22:04
问题 As we could see from The Computer Language Benchmarks Game in 2010: Go is on average 10x slower than C Go is 3x slower than Java !? How can this be, bearing in mind that Go compiler produces native code for execution? Immature compilers for Go? Or there is some intrinsic problem with the Go language? EDIT: Most answers deny intrinsic slowness of Go languge, claiming the problem resides in immature compilers. Therefore I've made some own tests to calculate Fibonacci numbers: Iterative

Load Testing with AB … fake failed requests (length)

北慕城南 提交于 2019-12-03 18:18:20
问题 To do some load testing, for my own curiosity, on my server I ran: ab -kc 50 -t 200 http://localhost/index.php This opens up 50 keep-alive connections for 200 seconds and just slams my server with requests for index.php In my results, I get: Concurrency Level: 50 Time taken for tests: 200.007 seconds Complete requests: 33106 Failed requests: 32951 (Connect: 0, Receive: 0, Length: 32951, Exceptions: 0) Write errors: 0 Keep-Alive requests: 0 Total transferred: 1948268960 bytes HTML transferred:

How long does my code take to run?

我怕爱的太早我们不能终老 提交于 2019-12-03 17:47:46
问题 How can I find out how much time my C# code takes to run? 回答1: Check out the Stopwatch class: Stopwatch sw = new Stopwatch(); sw.Start(); // your code here sw.Stop(); TimeSpan elapsedTime = sw.Elapsed; 回答2: The Stopwatch class offers high-precision timing in .NET. It is capable of measuring time with sensitivity of around 100s of nanoseconds (fractions of milliseconds). To get the exact resolution, read the value of Stopwatch.Frequency. var timer = System.Diagnostics.Stopwatch.StartNew(); //

Explain this JsPerf.com result

蹲街弑〆低调 提交于 2019-12-03 17:39:20
问题 I ran a test on this website http://jsperf.com/ I want some one to explain What does green and pink signifies What is ops per second what is 95,814,583 what is +- 1.95% is whats does 'fastest' and 'slower' means 回答1: Hey, I’m the creator of jsPerf. The fastest test(s) get a green background. The slowest test(s) get a pink/red background. See below. It means the test can run about 95,814,583 times a second. ± 1.95 is the margin of error. (For more info, see below.) “fastest” means this is the

Go HTTP server testing ab vs wrk so much difference in result

混江龙づ霸主 提交于 2019-12-03 17:36:22
I am trying to see how many requests the go HTTP server can handle on my machine so I try to do some test but the difference is so large that I am confused. First I try to bench with ab and run this command $ ab -n 100000 -c 1000 http://127.0.0.1/ Doing 1000 concurrent requests. The result is as follows: Concurrency Level: 1000 Time taken for tests: 12.055 seconds Complete requests: 100000 Failed requests: 0 Write errors: 0 Total transferred: 12800000 bytes HTML transferred: 1100000 bytes Requests per second: 8295.15 [#/sec] (mean) Time per request: 120.552 [ms] (mean) Time per request: 0.121

Speed difference between AES/CBC encryption and decryption?

拟墨画扇 提交于 2019-12-03 16:31:32
I am wondering, theoretically, how much slower would AES/CBC decryption be compared to AES/CBC encryption with the following conditions: Encryption key of 32 bytes (256 bits); A blocksize of 16 bytes (128 bits). The reason that I ask is that I want to know if the decryption speed of an implementation that I have is not abnormally slow. I have done some tests on random memory blocks of different sizes. The results are as follows: 64B: 64KB: 10MB – 520MB: All data was stored on the internal memory of my system. The application generates the data to encrypt by itself. Virtual memory is disabled

Why does Perl's tr/\n// get slower and slower as line lengths increase?

孤街浪徒 提交于 2019-12-03 16:20:51
问题 In perlfaq5, there's an answer for How do I count the number of lines in a file?. The current answer suggests a sysread and a tr/\n// . I wanted to try a few other things to see how much faster tr/\n// would be, and also try it against files with different average line lengths. I created a benchmark to try various ways to do it. I'm running this on Mac OS X 10.5.8 and Perl 5.10.1 on a MacBook Air: Shelling out to wc (fastest except for short lines) tr/\n// (next fastest, except for long

How to benchmark Node.js streams?

纵饮孤独 提交于 2019-12-03 16:18:30
How can I benchmark streams in Node.js? I've tried benchmark.js : var fs = require('fs'); var Transform = require('readable-stream').Transform; var util = require('util'); var Benchmark = require('benchmark'); var suite = new Benchmark.Suite; // my super uppercase stream function Uppercase(options) { if (!(this instanceof Uppercase)) return new Uppercase(options); Transform.call(this, options); } Uppercase.prototype = Object.create( Transform.prototype, { constructor: { value: Uppercase }}); Uppercase.prototype._transform = function(chunk, encoding, done) { chunk = chunk.toString().toUpperCase

.NET benchmarking frameworks

北慕城南 提交于 2019-12-03 15:34:44
Are there any .NET frameworks for writing micro-benchmarks like Japex or this (both are for Java)? Sam Saffron Jon Skeet wrote one: http://msmvps.com/blogs/jonskeet/archive/2009/01/26/benchmarking-made-easy.aspx It also lives on google-code Unfortunately, it not as rich as Japex Check this out, it is really cool library, VERY easy to use http://blogs.msdn.com/vancem/archive/2009/02/06/measureit-update-tool-for-doing-microbenchmarks.aspx The best feature I like in it is the normalization feature, it lets you compare different results in a meaningful way. Hope this helps I think you can try

Codeigniter query times and custom file logging

∥☆過路亽.° 提交于 2019-12-03 15:14:17
问题 I'm developing an app using Codeigniter 1.7.3 (yes, I know there's a new version, but I'm just too lazy to update). I noticed the Codeigniter built-in profiler outputs the query times. I want to access those times and write a custom log file with each query and each query time. To access the query I can user $this->db->last_query(). Is there any way to access those query times without hacking the core? Is there any library to write logs besides the system logs Codeigniter blundles? Thanks!