Questions tagged [benchmarking]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
337 views

C++ time profiler

How this code can be improved / simplified ? ...
3
votes
1answer
116 views

measuring the time taken to copy a std stl container

I'm trying to measure the time taken to copy a std::vector<someObject>. Would like to know if this is a correct approach. I tried to do some trivial ...
6
votes
2answers
5k views

Internet Speed Calculator

This program calculates up and downspeed of a given connection for as long as it is running. ...
5
votes
3answers
650 views

Digital root computation with benchmarking

I've read this question about computing the digital root of some integer, and wondered how it would look like in Python. As a reminder, "If you take the digits of any number and add them together, ...
3
votes
3answers
249 views

Helper utilities for easier benchmarking in C

I have this tiny library for measuring the execution time in milliseconds and returning the duration plus the result: execres.h ...
1
vote
0answers
79 views

Micro bench marking using JMH

I am learning to write micro bench marks for Java methods. I read that while writing methods for bench marking we should be careful of writing code which compiler/JVM can optimize. I have writeen my ...
3
votes
1answer
359 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
1k 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
137 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 ...
46
votes
3answers
6k 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
262 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
129 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
84 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
141 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 ...
10
votes
2answers
190 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
650 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
1k 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
103 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
76 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
796 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
568 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
6k 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
519 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
385 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, ...
13
votes
2answers
5k 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
152 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
133 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 ...
16
votes
2answers
4k 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
154 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
449 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 ...
25
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 ...

1
2