Questions tagged [benchmarking]

Questions about code that is primarily intended to measure the execution time of code

Filter by
Sorted by
Tagged with
13
votes
1answer
1k views

Comparing std::vector<bool> to std::vector<char>

A recent comment to an answer of mine here on Code Review brought up an interesting point. The comment was that one should use std::vector<char> over ...
11
votes
1answer
148 views

YAuB - Micro Benchmark Follow-on

Following some great advice here from Simon, I realized that I had over-engineered things, and that the Task builder methods were a horrible Java8 abstraxction. In Simon's words: "From a usability ...
3
votes
1answer
120 views

Abstract graphing-and-timing functions

I like to use timeit to measure performance of small, and sometimes big, functions. However it can be uncertain as to what the 'actual' time to execute the function ...
14
votes
3answers
1k views

Simple micro-benchmarking library

I'm working on a simple micro-benchmarking library in Java. This library makes it easy to benchmark multiple reference implementations. You provide the inputs and trigger the calls, the library takes ...
11
votes
1answer
129 views

YAuB - Yet another Micro Benchmark

Note -> Follow-on question posted here: YAuB - Micro Benchmark Follow-on I recently answered this Beautiful String question, where the task is to maximize the value of a string by assigning each ...
44
votes
3answers
5k views

Benchmarking things in C#

I needed a better way to benchmark code, because, well, rewriting the same benchmarking code every time I need it is just...well...unpleasant. So, here's a class which does just that, it runs an <...
12
votes
1answer
12k views

Decorator to measure execution time of a function

This decorator adds the elapsed time to a function's attributes when applied. My concerns: Is the code pythonic? Could this code be useful? Should I just use the ...
14
votes
2answers
3k views

VBA Code Profiling

I have wanted a way to do code profiling in VBA for quite some time. It becomes very complicated to figure out what methods are actually being executed for how long and how often in complex Access ...
8
votes
2answers
163 views

Associating degrees with notes of scales

I have a JS file that creates an object with notes from a music scale when given a key (aka tonic/ note). The code works and does what I want it to do. I need a critique on the way it's written, what ...
7
votes
1answer
299 views

C++ benchmark v2

The purpose of the code is to simplify benchmarking of arbitrary functions. The reason I want to benchmark things is that I would like to get a "feeling" of performance. Although the framework leans ...
5
votes
1answer
87 views

Benchmarking String splitting - follow-up

This is a follow-up from: Reversing a domain name string in Java There are a number of ways of splitting a String using a delimiter in Java, especially now with ...
3
votes
1answer
175 views

A rather accurate VBA stopwatch

Intro Related, related I'm trying to come up with a neat, accurate way of timing VBA code, as I'm yet to find a method to do this in VBA directly (without plugins etc.) The general idea was to ...
1
vote
1answer
37 views

A simple Java class for implementing code stop watches - follow-up

I have received a nice answer for this post. Now, it is my attempt for some improvement: ...
1
vote
1answer
57 views

A simple Java class for implementing code stop watches

(The next iteration: A simple Java class for implementing code stop watches - follow-up) Here is my attempt at more convenient benchmarking (yes, this time I am aware of JVM warmup, etc.), and it ...
0
votes
2answers
726 views

Effective Python 2/3 two-dimensional array initialisation

Recently I noticed that the idiomatic python two-dimensional array initialisation is extremely slow. I am wondering, is there a good, proper way of doing this simple task fast? Also, are those two ...