Questions tagged [benchmarking]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
263 views

Testing different implementations of malloc()

Can you help me verify my test result? I'm testing different malloc() implementations with a small program that allocates gigabytes many times: ...
0
votes
2answers
724 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 ...
3
votes
3answers
131 views

Write the running time to file without capturing the program's output

I want to run an application and write (append) its processing time into a file. Also, I want to see the stdout and stderr output on the shell, but don't want to write it in a file. After running the ...
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 <...
2
votes
0answers
221 views

Measuring the execution time of C++ code

I've written a small C++ utility that is intended for measuring the execution time of blocks of code, and I'd appreciate your feedback on it. I'm an experienced programmer, but a novice C++ programmer....
-1
votes
1answer
115 views

Measuring execution time of a simple operation

The purpose of the following code is to measure the execution time of a simple operation (1+1) and of a call to a function who does nothing (foo). The code ...
2
votes
0answers
69 views

Benchmarking function variations

I'm trying to benchmark two variations of one of my functions. Namely, these functions are for displaying integer values on the command line. The first of these uses my own implementation and prints ...
1
vote
1answer
82 views

Measuring CPU frequency in *nix

I have this small function for reading the TSC (time-stamp counter) in *nix. Using it seems to report my CPU frequency more or less correctly. ...
5
votes
1answer
123 views

VBA code for testing efficency

I am currently trying out code for timing efficiency (how fast it runs, basically). The general consensus is that code with ActiveCell,...
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 ...
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 ...
2
votes
2answers
601 views

str_replace vs array_map & trim on URL segments

Are there any advantages on using array_map & trim vs using simple str_replace? The ...
7
votes
3answers
962 views

Measuring performance of code using StopWatch

I have created a StopWatch class to measure the performance of any code. I use this StopWatch code in any of my multithreading projects as well. ...
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
2answers
68 views

Visualize the runtimes of list algorithms

I wrote a small script to visualize the runtimes of list algorithms. The script works by creating a list of lists with sampled lengths from 1 to max_size. Next, I ...
3
votes
2answers
616 views

Timing Python functions in two ways

When reviewing questions here on Code Review SE, I sometimes find my self wanting to test different functions in order to do a performance review. However since I'm inherently lazy, I wonder what is ...
4
votes
2answers
5k views

Function for timing executions (inspired by MATLAB tic toc)

Inspired by MATLAB's tic/toc I've written a short helper function for calculating execution time. ...
13
votes
2answers
491 views

A low tech approach to measuring game speed

Whilst developing a game I needed a delay routine capable of doing delays ranging from 0.5 sec to just a few msec. The obvious choice was to use the BIOS delay function 86h on int 15h. In a true real ...
22
votes
4answers
5k views

Performing and timing loops with SQL queries

I am a casual C# programmer, not formally trained in OOP at all; mostly I focus on Transact-SQL in SQL Server, and so when I write C# apps I get grief about the constructs and methods I use. Here is a ...
11
votes
1answer
1k views

Scanner in Scala

I wanted to implement Java's Scanner in Scala. The goal for this class is to: Implement a Scala collection interface (probably ...
7
votes
2answers
449 views

Benchmark a sorting method for fixed-size arrays

During the past few days, I have written a small C++14 library which mainly provides the cppsort::sort function. It is designed to efficiently sort small arrays ...
4
votes
2answers
1k views

Measure execution time of sorting algorithms

I have to measure execution time of certain sorting algorithms being passed as functions in following program. I also do not have to measure it on random container but also on ascending as well as ...
4
votes
2answers
384 views

Testing third parth software performance [closed]

This is a simple example of script to run the test write/read performance of third party software of the drive in Windows environment. Please let me know if you find any place can be better improved, ...
11
votes
2answers
4k views

JMH Benchmark Metrics Evaluation

I'm currently attempting to learn some basic JVM optimization techniques using JMH. I created the following bench to compare mid-index insertion performance between ...
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 ...
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 ...
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 ...
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 ...
2
votes
1answer
153 views

Benchmark/timer library - follow-up

I created a timer library called PHPBenchTime a few years ago, and decided to rewrite it last week. This new version is meant to add in missing functionality (pause/unpause) as well as expand on the ...
11
votes
2answers
434 views

Micro-Benchmark framework

Performance benchmarking small functions in Java is notoriously difficult, and there are a number of tools out there to help (caliper, others). Those other tools require a fair amount of setup and ...
23
votes
6answers
3k views

HashSet and TreeSet

I got some homework in which I had to take the novel War and Peace and put it into a HashSet and TreeSet respectively. I had to time it, to check differences and my question is whether my ...