Questions tagged [microbenchmark]

A microbenchmark attempts to measure the performance of a "small" bit of code. These tests are typically in the sub-millisecond range. The code being tested usually performs no I/O, or else is a test of some single, specific I/O task.

Microbenchmarking is very different from profiling! When profiling, you work with an entire application, either in production or in an environment very painstakingly contrived to resemble production. Because of this, you get performance data that is, for lack of a better term, real. When you microbenchmark, you get a result that is essentially fictional, and you must be very careful about what conclusions you draw from it.

Still, for either type always apply the old adage:
Premature optimization is the root of all evil.

485 questions
0
votes
1 answer

Why is my python aes-ctr-128 micro benchmark with block by block encryption slow?

I designed an puzzle algorithm to take the value of each encrypted block which point to the next block to be encrypted. I have to use aes-ctr-128 for that with some particular reason. I run a dummy test to see how fast or slow it could be. Here is…
Luke
  • 281
  • 2
  • 7
  • 19
0
votes
0 answers

Why I can not use 100%cpu in the memtier_benchmark test

I want to test the memcached using the memtier_benchmark. under my thought, if we use small bytes message under many concurrency requests, the cpu can be used almost close to 100%, but in fact the actual cpu usage is just about 10% in the kernel,…
Djvu
  • 605
  • 1
  • 5
  • 18
0
votes
2 answers

Run Micro-benchmark in application servers [JMH]

I read about JMH and tried the samples provided. What I am trying to do is measure the stats of following scenario, [ 1] client order -> [2] server -> [3] start processing the order -> [4] processed the order successfully and ready to send -> [5]…
Isuru Gunawardana
  • 2,847
  • 6
  • 28
  • 60
0
votes
4 answers

Python: why is it faster to iterate over a list than iterating over an xrange() generator define on its length?

Why is iterating over a list faster than iterating over an xrange generator defined on the list length? Input: timeit.timeit('for _ in dummy: continue', setup='dummy=xrange(10000)', number=100000) timeit.timeit('for _ in dummy: continue',…
marcorossi
  • 1,941
  • 2
  • 21
  • 34
0
votes
0 answers

MySQL stored functions with foreign keys check vs simple direct calls from PHP

I am designing the database for online card game with MySQL and PHP. I know that both of them are not the speed daemons recommended for online games, but they work fine for my project. I am at the optimization phase (the game alpha is ready and…
PolGraphic
  • 3,233
  • 11
  • 51
  • 108
0
votes
1 answer

Program efficency when contracting Strings vs making a new String w/ edits to the original one

I was just wondering about the efficency of the following two codes: public void appendInput(String s, boolean isCommand) { s = "\n" + (isCommand == true ? ">" : "") + s + "\n"; getConsoleInput().append(s); //vs …
nyxaria
  • 479
  • 1
  • 3
  • 13
0
votes
1 answer

Caliper error Use microbenchmark instrument

I don't seem to be able to get started here. I pulled down the code and built caliper myself, which solved my first set of problems, but now I am getting errors that I need a microinstrument This experiment requires a microbenchmark. The…
0
votes
1 answer

Filling ArrayList vs LinkedList

I have been thinking that LinkedList fills faster than ArrayList. As I know ArrayList is based on simple array with limited length(constant). So every time array is out of range, new array with higher range will be created. LinkedList is much…
Tony
  • 3,605
  • 14
  • 52
  • 84
0
votes
0 answers

system.time() for .Call()

Trying to set up a benchmark in R, I run a large set of different inputs on a .Call() and measure (=median of 100 replicates) the elapsed time with: system.time() microbenchmark() checking proc.time() before and after the function…
blosloos
  • 21
  • 3
0
votes
0 answers

Is there a way to benchmark a browser?

I'm working on an application that sends data to browser clients which will execute some computation and send me back the result. I need a criterion to decide how much data I can send to the browsers. To do so I thought about inspecting the CPU of…
Masiar
  • 20,450
  • 31
  • 97
  • 140
0
votes
0 answers

Worker threads much worse performance than main

I have a small test program that compiles alongside my library for testing the speeds of various mathematics functions when using different methods (SSE, for-loop, unrolled-loop, ect). These test run over the different methods hundreds of thousands…
RamblingMad
  • 5,332
  • 2
  • 24
  • 48
0
votes
0 answers

Creating a function use more resources in PHP?

Simple question really. More or less another micro-brenchmarking question due to pure curiousity! But, does creating a function use more resource (memory and/or CPU) in PHP? Here's an example: function test() { return 1+1; } echo…
tfont
  • 10,891
  • 7
  • 56
  • 52
0
votes
2 answers

Why is calling a function faster than not calling a function?

I tried the following code: public class Test { public static void main(String[] args) { int x = 9, y = 9, z = 0; long startTime = System.currentTimeMillis(); // System.out.println("loop one start time = " + startTime); …
jack
  • 93
  • 1
  • 1
  • 6
0
votes
0 answers

Multiple 500 errors when google caliper tries to upload benchmark results to microbenchmarks.appspot.com

I'm seeing multiple HTTP 500 errors when Caliper tries to upload the JSON result files for the benchmarks I'm running. The logs are filled with exceptions similar to the one below: Dec 19, 2013 3:29:20 PM com.google.caliper.runner.ResultsUploader…
kodeninja
  • 339
  • 1
  • 7
  • 23
0
votes
1 answer

Best way to hard-code a giant array for benchmarking

I want to hard code a giant array of integers in my program. I'm doing this because I want to benchmark a sorting algorithm. If I store the array as a text file and I read it in, then I will be measuring the performance of reading in a reading in…
J-bob
  • 8,380
  • 11
  • 52
  • 85