microbenchmark Questions
2
I measure cpu time and wall time of sorting algorithms on linux. Im using getrusage to measure a cpu time and clock_gettime CLOCK_MONOTONIC to get a wall time. Althought I noticed that a cpu time i...
Rootstock asked 24/7, 2013 at 19:53
1
Anyone in computer science will know that HeapSort is O(n log n) worst case in theory, while QuickSort is O(n^2) worst case. However, in practice, a well implemented QuickSort (with good heuristics...
Indigenous asked 5/7, 2013 at 16:52
2
Solved
I have been micro benchmarking the following code and I noticed something interesting that I am hoping somebody can shed more light on. It leads to a situation where it looks like a for loop can ca...
Broaddus asked 11/4, 2013 at 9:8
2
Solved
When writing microbenchmarks, one can observe a large difference in runtime depending on whether a method has been compiled or not. Is there a way to tell from within a program whether a particular...
Opia asked 17/11, 2012 at 22:30
3
Why is here the sub eins with the else slower than the sub zwei with the elsif?
#!/usr/bin/env perl
use warnings;
use 5.012;
use Benchmark qw(:all);
my $d = 0;
my $c = 2;
sub eins {
if ( $c == ...
Horseflesh asked 11/6, 2012 at 9:41
2
Solved
I've always been bugged a bit by the lack of accuracy I see bench marking with system.time and rbenchmark (in that the precision of the timing may be lacking) and saw Hadley reference the microbenc...
Motorcycle asked 28/4, 2012 at 15:50
11
Solved
The following code checks if x and y are distinct values (the variables x, y, z can only have values a, b, or c) and if so, sets z to the third character:
if x == 'a' and y == 'b' or x == 'b' and ...
Mertiemerton asked 9/1, 2012 at 17:21
4
I came across this question, which compared the performance of various compilers on computing fibonaci numbers the naive way.
I tried doing this with Haskell to see how it compares to C.
C code:
...
Jipijapa asked 16/7, 2011 at 8:39
3
Solved
I know that length(x) returns max(size(x)) and numel(x) returns the total number of elements of x, but which is better for a 1 by n array? Does it matter, or are they interchangeable in this case? ...
Arterialize asked 25/6, 2010 at 16:33
1
Solved
First of all, this is not about the usefulness of microbenchmarks. I'm well aware of their purpose: Indicating performance characteristics and comparison in a very specific case to highlight a sing...
Berylberyle asked 18/5, 2010 at 13:4
13
Solved
considering this example:
public static void main(final String[] args) {
final List<String> myList = Arrays.asList("A", "B", "C", "D");
final long start = System.currentTimeMillis();
for ...
Acklin asked 4/3, 2010 at 23:10
20
Update: 2009-05-29
Thanks for all the suggestions and advice. I used your suggestions to make my production code execute 2.5 times faster on average than my best result a couple of days ago. In th...
Rasberry asked 27/5, 2009 at 22:48
11
Solved
In benchmarking some Java code on a Solaris SPARC box, I noticed that the first time I call the benchmarked function it runs EXTREMELY slowly (10x difference):
First | 1 | 25295.979 ms
Second | 1...
Illustrator asked 13/5, 2009 at 20:28
8
Solved
Here is a sample code:
public class TestIO{
public static void main(String[] str){
TestIO t = new TestIO();
t.fOne();
t.fTwo();
t.fOne();
t.fTwo();
}
public void fOne(){
long t1, t2;
t1 =...
Ha asked 29/4, 2009 at 22:48
1
Solved
I'm writing some micro-benchmarking code for some very short operations in C. For example, one thing I'm measuring is how many cycles are needed to call an empty function depending on the number of...
Cerracchio asked 22/2, 2009 at 17:52
© 2022 - 2024 — McMap. All rights reserved.