benchmarking

How to multiply a benchmark

寵の児 提交于 2019-12-25 17:07:03
问题 Say I have a benchmark result like so: 0.020000 0.000000 0.020000 ( 0.020197) I'm creating this with something like Benchmark.bm do |x| x.report { run_a_method() } end This represents the time required to call a method foo one time. I want to produce a benchmark which shows the result of running foo 3 times, but only requires calling the method once. This can be done by simply multiplying the values in the first benchmark by 3. Is there any way to do this? Edit I'm not really appreciating the

Why is this simplistic cpp function version slower?

我与影子孤独终老i 提交于 2019-12-25 09:51:33
问题 Consider this comparison: require(Rcpp) require(microbenchmark) cppFunction('int cppFun (int x) {return x;}') RFun = function(x) x x=as.integer(2) microbenchmark(RFun=RFun(x),cppFun=cppFun(x),times=1e5) Unit: nanoseconds expr min lq mean median uq max neval cld RFun 302 357 470.2047 449 513 110152 1e+06 a cppFun 2330 2598 4045.0059 2729 2879 68752603 1e+06 b cppFun seems slower than RFun . Why is it so? Do the times for calling the functions differ? Or is it the function itself that differ in

Why is this simplistic cpp function version slower?

纵然是瞬间 提交于 2019-12-25 09:50:05
问题 Consider this comparison: require(Rcpp) require(microbenchmark) cppFunction('int cppFun (int x) {return x;}') RFun = function(x) x x=as.integer(2) microbenchmark(RFun=RFun(x),cppFun=cppFun(x),times=1e5) Unit: nanoseconds expr min lq mean median uq max neval cld RFun 302 357 470.2047 449 513 110152 1e+06 a cppFun 2330 2598 4045.0059 2729 2879 68752603 1e+06 b cppFun seems slower than RFun . Why is it so? Do the times for calling the functions differ? Or is it the function itself that differ in

Run benchmark but don't print the result

故事扮演 提交于 2019-12-25 06:24:05
问题 I have a benchmark like follows: benchmark_result = Benchmark.bm do |x| x.report { send(test_name) } end When I run this, I'm seeing output from two places: The send(test_name) in the report block. I want to continue seeing this output. The output from the Benchmark block, i.e. the resulting benchmark report is printed to the console. I don't want this to happen. I've seen from here how to temporarily hide the console output. But the problem is that I want the inner block to continue printing

Using tic toc for benchmark MATLAB

…衆ロ難τιáo~ 提交于 2019-12-25 06:00:12
问题 yesterday I was testing whether using a for loop for adding up elements in and array was worse than using the built-in MATLAB function sum (As far I understand this should be the case, since built-in functions are pre-compiled), however I got some weird results: r = rand(1e8, 1); tic sum1 = 0; for i = 1:1e8 sum1 = sum1 + r(i); end t1 = toc; tic sum2 = sum(r); t2 = toc; >> t1 t1 = 0.5872 >> t2 t2 = 0.1053 it gives me those results (MATLAB 2011). However I tested it in MATLAB 2013, and using

Spark cluster does not scale to small data

最后都变了- 提交于 2019-12-25 05:07:33
问题 i am currently evaluating Spark 2.1.0 on a small cluster (3 Nodes with 32 CPUs and 128 GB Ram) with a benchmark in linear regression (Spark ML). I only measured the time for the parameter calculation (not including start, data loading, …) and recognized the following behavior. For small datatsets 0.1 Mio – 3 Mio datapoints the measured time is not really increasing and stays at about 40 seconds. Only with larger datasets like 300 Mio datapoints the processing time went up to 200 seconds. So

Improving data.table subsetting performance

时光怂恿深爱的人放手 提交于 2019-12-25 01:08:52
问题 I am running a large monte-carlo simulation, and I discovered that sub-setting/searching my data is the slowest part of my code. In order to test some alternatives, I bench-marked performance with dataframes, data.table, and a matrix. Here is the benchmark code: library(data.table) #install.packages('profvis') library(profvis) x.df = data.frame(a=sample(1:10,10000,replace=T), b=sample(1:10,10000,replace=T)) # set up a dataframe x.dt = as.data.table(x.df) # a data.table setkey(x.dt,a) # set

On-the-fly data generation for benchmarking Beam

孤街浪徒 提交于 2019-12-24 19:33:58
问题 My goal is to benchmark the latency and the throughput of Apache Beam on a streaming data use-case with different window queries. I want to create my own data with an on-the-fly data generator to control the data generation rate manually and consume this data directly from a pipeline without a pub/sub mechanism, i.e. I don't want to read the data from a broker, etc. to avoid bottlenecks. Is there a way of doing something similar to what I want to achieve? or is there any source code for such

Benchmarks of code generated by different g++ versions

依然范特西╮ 提交于 2019-12-24 16:14:43
问题 I work on a runtime system for an application domain that is very performance sensitive. We go to a lot of effort to maintain backward compatibility with older compiler versions, including avoiding more recently-implemented language constructs, and synthesizing them for the older versions. However, I'm concerned that this effort does a disservice to our users, by enabling them to continue to use compiler releases that are costing them huge amounts of performance. Unfortunately, I haven't been

MySQLi query vs PHP Array, which is faster?

谁说我不能喝 提交于 2019-12-24 12:05:47
问题 I'm developing an algorithm for intense calculations on multiple huge arrays. Right now I have used PHP arrays to do the job but, it seems slower than what I needed it to be. I was thinking on using MySQLi tables and convert the php arrays into database rows and then start the calculations to solve the speed issue. At the very first step, when I was converting a 20*10 PHP array into 200 rows of database containing zeros, it took a long time. Here is the code: (Basically the following code is