benchmarking

Performance difference between MRI Ruby and jRuby

折月煮酒 提交于 2019-12-23 10:43:13
问题 While doing some benchmarking to answer this question about the fastest way to concatenate arrays I was surprised that when I did the same benchmarks in with jRuby the tests were a lot slower. Does this mean that the old adagio about jRuby being faster than MRI Ruby is gone ? Or is this about how arrays are treated in jRuby ? Here the benchmark and the results in both MRI Ruby 2.3.0 and jRuby 9.1.2.0 Both run on a 64bit Windows 7 box, all 4 processors busy for 50-60%, memory in use ± 5.5GB.

Fastest way of converting integer to string in java

99封情书 提交于 2019-12-23 10:15:09
问题 Everytime I had to convert an int into a String I picked either ""+a or Integer.toString(a) . Now I wondered which way is faster, so I wrote a simple benchmark that calls function_1, function_2 and function_3 10000000 times and prints how long it takes to process the functions. Here are the functions: public static String i=""; public static String j=""; public static String k=""; public static void function_1() { i=Integer.toString(getOne()); } public static void function_2() { j=""+1; }

does a primary key speed up an index?

旧巷老猫 提交于 2019-12-23 08:51:25
问题 Aside from the convenient auto-increment and UNIQUE features, does the PK actually speed up the index? Will the speed be the same whether it's a non-PKed indexed INT or PKed (same column, two different tests)? If I had the same column on the same table on the same system, will it be faster if a UNIQUE INT column with an index also has PK enabled? Does PK make the index it coexists with faster? Please, actual results only with system stats if you could be so kind. 回答1: The primary key for a

When are Schwartzian Transforms useful?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 07:56:17
问题 While going through the "Intermediate Perl" book I noticed a section on Schwartzian Transforms and tried the example in the exercise (9.9.2) but noticed that multiple runs resulted in the transform taking more time then the normal sort. The code here performs a simple sort of the files in the windows\system32 directory based on file size - #!/usr/bin/perl use strict; use warnings; use Benchmark; my $time = timethese( 10, { testA => sub { map $_->[0], sort {$a->[1] <=> $b->[1]} map [$_, -s $_]

Insert random data in MySql and PHP for benchmark

我是研究僧i 提交于 2019-12-23 03:59:13
问题 I was wondering if there is a (free) tool for mysql/php benchmark. In particular, I would like to insert thousands of data into the MySQL database, and test the application with concurrent queries to see if it will last. This is, test the application in the worst cases. I saw some pay tools, but none free or customizable one. Any suggestion? or any script? Thnx 回答1: Insert one record into the table. Then do: INSERT IGNORE INTO table SELECT FLOOR(RAND()*100000) FROM table; Then run that line

Importing multiple versions of the same Module/Package for Benchmarking

旧巷老猫 提交于 2019-12-23 03:12:13
问题 I am working on a Package, this package using BinDeps to pull in some C source code, and compile some binaries. My julia module then mostly just exposes ccalls to those functions. Now there are about 5 different options for how the C source can be compiled, with various different optimisations turned on. And to go with them various other changes that are triggered by by a constant that is written to the deps.jl that is output by BinDeps. So I would like to import each of the different builds

Performance benchmark of native android map vs webview map, what parameters can be included in the benchmark

前提是你 提交于 2019-12-23 02:35:00
问题 I am trying to compare native google maps (v2) vs the embeddable HTML version encapsulated in a webview on android. While it's pretty evident that the native maps are smoother and faster, I must prove that somehow. I have been searching on the internet for quite some time and did not seem to find any existing benchmarks. Does anybody know someone who actually done something similar? I am already thinking of creating such benchmark of my own, but how can the performance actually be measured?

C++ Benchmark tool

不想你离开。 提交于 2019-12-23 01:55:44
问题 I have some application, which makes database requests. I guess it doesn't actually matter, what kind of the database I am using, but let's say it's a simple SQLite -driven database. Now, this application runs as a service and does some amount of requests per minute (this number might actually be huge). I'm willing to benchmark the queries to retrieve their number, maximal / minimal / average running time for some period and I wish to design my own tool for this (obviously, there are some,

Benchmarking - How to count number of instructions sent to CPU to find consumed MIPS

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 01:29:37
问题 Consider I have a software and want to study its behavior using a black-box approach. I have a 3.0GHz CPU with 2 sockets and 4 cores. As you know, in order to find out instructions per second (IPS) we have to use the following formula: IPS = sockets*(cores/sockets)*clock*(instructions/cycle) At first, I wanted to find number of instructions per cycle for my specific algorithm. Then I realised its almost impossible to count it using a block-box approach and I need to do in-depth analysis of

Why does IntStream.range(0, 100000).parallel().foreach take longer then normal for loop

二次信任 提交于 2019-12-23 01:12:20
问题 I am just starting to learn about the Streams and parallel in Java and I was wondering why a normal for loop takes less time than IntStream paralleled at adding items to an array. package parallel; import java.util.stream.IntStream; public class Parallel { public static void main(String[] args) { final int[] intArray = new int[100000]; long startTime = System.currentTimeMillis(); IntStream.range(0, 100000).parallel().forEach(i -> intArray[i]=i); long endTime = System.currentTimeMillis();