benchmarking

Strange performance drop of JDK8 LocalDate.toEpochDay

好久不见. 提交于 2019-12-01 18:21:13
I was curious if we finally get a fast datetime library with JDK8. Nearly all LocalDate computations use toEpochDay so I looked at the source and the large number of divisions and branches made me curious if I could do better. I eliminated some branching and all but one division, however the speedup is worse than expected. So my first question how is it possible that an algorithm using multiple division takes only about 30 cycles (throughput). Holger's comments seem to have answered this: Division by a small constant gets JIT-ed to multiplication. I did it manually and now I'm consistently

PHP Performance : Copy vs. Reference

时光怂恿深爱的人放手 提交于 2019-12-01 17:03:32
Hey there. Today I wrote a small benchmark script to compare performance of copying variables vs. creating references to them. I was expecting, that creating references to large arrays for example would be significantly slower than copying the whole array. Here is my benchmark code: <?php $array = array(); for($i=0; $i<100000; $i++) { $array[] = mt_rand(); } function recursiveCopy($array, $count) { if($count === 1000) return; $foo = $array; recursiveCopy($array, $count+1); } function recursiveReference($array, $count) { if($count === 1000) return; $foo = &$array; recursiveReference($array,

pathinfo vs fnmatch

。_饼干妹妹 提交于 2019-12-01 17:01:03
问题 There was a small debate regarding the speed of fnmatch over pathinfo here : how to check if file is php? I wasn't totally convinced so decided to benchmark the two functions. Using dynamic and static paths showed that pathinfo was faster. Is my benchmarking logic and conclusion valid? EDIT : Using mac php from cmd PHP 5.3.0 (cli) (built: Jul 20 2009 13:56:33) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies dynamic path pathinfo 3

pathinfo vs fnmatch

ぐ巨炮叔叔 提交于 2019-12-01 16:31:25
There was a small debate regarding the speed of fnmatch over pathinfo here : how to check if file is php? I wasn't totally convinced so decided to benchmark the two functions. Using dynamic and static paths showed that pathinfo was faster. Is my benchmarking logic and conclusion valid? EDIT : Using mac php from cmd PHP 5.3.0 (cli) (built: Jul 20 2009 13:56:33) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies dynamic path pathinfo 3.2973630428314 fnmatch 3.4520659446716 x1.05 static path pathinfo 0.86487698554993 fnmatch 1.0420439243317 x1.2

PHP Performance : Copy vs. Reference

走远了吗. 提交于 2019-12-01 15:49:00
问题 Hey there. Today I wrote a small benchmark script to compare performance of copying variables vs. creating references to them. I was expecting, that creating references to large arrays for example would be significantly slower than copying the whole array. Here is my benchmark code: <?php $array = array(); for($i=0; $i<100000; $i++) { $array[] = mt_rand(); } function recursiveCopy($array, $count) { if($count === 1000) return; $foo = $array; recursiveCopy($array, $count+1); } function

R with 36 cores is much slower than R with 8 cores

久未见 提交于 2019-12-01 13:04:30
问题 On the right hand side is the result from EC2 instance with 36 cores and 64GB RAM while on the left is my laptop with 8 cores and 8GB RAM. I'm new to running R on AWS EC2 instance, so probably I need to configure my R in order to make use of the EC2 instance raw compute power. Could someone please advise on how or is there anything that I miss here? Thanks! 回答1: I found the better answer here. Quite disappointing with the unnecessary downvotes. https://github.com/csantill/RPerformanceWBLAS

Bring code into the L1 instruction cache without executing it

霸气de小男生 提交于 2019-12-01 12:31:23
Let's say I have a function that I plan to execute as part of a benchmark. I want to bring this code into the L1 instruction cache prior to executing since I don't want to measure the cost of I$ misses as part of the benchmark. The obvious way to do this is to simply execute the code at least once before the benchmark, hence "warming it up" and bringing it into the L1 instruction cache and possibly the uop cache, etc. What are my alternatives in the case I don't want to execute the code (e.g., because I want the various predictors which key off of instruction addresses to be cold)? One

Bring code into the L1 instruction cache without executing it

风流意气都作罢 提交于 2019-12-01 10:13:24
问题 Let's say I have a function that I plan to execute as part of a benchmark. I want to bring this code into the L1 instruction cache prior to executing since I don't want to measure the cost of I$ misses as part of the benchmark. The obvious way to do this is to simply execute the code at least once before the benchmark, hence "warming it up" and bringing it into the L1 instruction cache and possibly the uop cache, etc. What are my alternatives in the case I don't want to execute the code (e.g.

Measuring and benchmarking processing power of a javascript engine in a browser

有些话、适合烂在心里 提交于 2019-12-01 09:14:19
What is an accurate way to measure the performance of a javascript engine like v8 or spidermonkey ? It should at least have not very high deviations from one evaluation and another, probably allow to rank between different javascript engines on different operating systems and different hardware configurations. My first attempt was this in a web page with nothing on it, I loaded that page in web browsers. Then I tried executing this code in Google Chrome's javascript console and it came out very different as you'll see in the results: mean = function (distr) { var sum = 0; for (obs in distr) {

How can I measure the performance and TCP RTT of my server code?

青春壹個敷衍的年華 提交于 2019-12-01 06:06:17
I created a basic TCP server that reads incoming binary data in protocol buffer format, and writes a binary msg as response. I would like to benchmark the the roundtrip time. I tried iperf, but could not make it send the same input file multiple times. Is there another benchmark tool than can send a binary input file repeatedly? If you have access to a linux or unix machine 1 , you should use tcptrace . All you need to do is loop through your binary traffic test while capturing with wireshark or tcpdump file. After you have that .pcap file 2 , analyze with tcptrace -xtraffic <pcap_filename> 3