benchmarking

Java vs C#: Are there any studies that compare their execution speed?

我与影子孤独终老i 提交于 2019-12-17 22:38:05
问题 Taking out all of the obvious caveats related to benchmarks and benchmark comparison, is there any study (an array of well documented and unbiased tests) that compares the average execution speed of the two mentioned languages? Thanks 回答1: The best comparison that I am aware of is The Computer Language Benchmarks Game. It compares speed, memory use and source code size for (currently) 10 benchmarks across a large number of programming languages. The implementations of the benchmarks are user

Looking for benchmarking code snippet (c++)

走远了吗. 提交于 2019-12-17 22:15:22
问题 Some loading routines in my program takes to long to complete. I want a quick small snippet for checking how long a function took to execute. By small I mean "preferably without 3rd party libraries". Maybe something as simple as taking the system time? start = current_system_time() load_something() delta = current_system_time()-start log_debug("load took "+delta) Edit: Target OS in question is Windows. 回答1: Your answer: Yes Caveat: That WON'T work in multihtreaded code or multiple core

Is Intel's timestamp reading asm code example using two more registers than are necessary?

泪湿孤枕 提交于 2019-12-17 19:22:31
问题 I'm looking into measuring benchmark performance using the time-stamp register (TSR) found in x86 CPUs. It's a useful register, since it measures in a monotonic unit of time which is immune to the clock speed changing. Very cool. Here is an Intel document showing asm snippets for reliably benchmarking using the TSR, including using cpuid for pipeline synchronisation. See page 16: http://www.intel.com/content/www/us/en/embedded/training/ia-32-ia-64-benchmark-code-execution-paper.html To read

What's the best way to benchmark programs in Windows?

我是研究僧i 提交于 2019-12-17 18:30:12
问题 I need to do some performance benchmarks on .NET programs (C#) in Windows, but I haven't done benchmarking much in the Windows world. I've looked into using the Windows 2000/XP Performance monitor with custom counters for this, but I don't think this is quite what I want. Are there any good system facilities for this in Windows XP, or do I need to just use System.Diagnostics.Stopwatch [edit] and write text logs for manual interpretation, or is there something else? Edit: is there anything

How to measure network performance (how to benchmark network protocol)

谁说胖子不能爱 提交于 2019-12-17 18:25:01
问题 First, a bit of a background. There are many various comparisons of distributed version control systems (DVCS) which compare size of repository, or benchmark speed of operations. I haven't found any that would benchmark network performance of various DVCS, and various protocols used... beside measuring speed of operations (commands) involving network like 'clone', 'pull'/'fetch' or 'push'. I'd like to know then how would you make such comparison; how to measure network performance of an

How to use python timeit when passing variables to functions?

六眼飞鱼酱① 提交于 2019-12-17 17:25:04
问题 I'm struggling with this using timeit and was wondering if anyone had any tips Basically I have a function(that I pass a value to) that I want to test the speed of and created this: if __name__=='__main__': from timeit import Timer t = Timer(superMegaIntenseFunction(10)) print t.timeit(number=1) but when I run it, I get weird errors like coming from the timeit module.: ValueError: stmt is neither a string nor callable If I run the function on its own, it works fine. Its when I wrap it in the

How to benchmark Boost Spirit Parser?

久未见 提交于 2019-12-17 16:06:30
问题 I'm working on a compiler and I would like to improve its performances. I found that about 50% of the time is spent parsing the source files. As the source file are quite small and I do quite a lot of transformations after that, it seems to me that it is perfectible. My parser is a Boost Spirit parser with a lexer (with lexer::pos_iterator) and I have a middle sized grammar. I'm parsing the source into an AST. My problem is that I have no idea what takes the most time during the parsing:

Why does Matlab run faster after a script is “warmed up”?

醉酒当歌 提交于 2019-12-17 16:04:16
问题 I have noticed that the first time I run a script, it takes considerably more time than the second and third time 1 . The "warm-up" is mentioned in this question without an explanation. Why does the code run faster after it is "warmed up"? I don't clear all between calls 2 , but the input parameters change for every function call. Does anyone know why this is? 1. I have my license locally, so it's not a problem related to license checking. 2. Actually, the behavior doesn't change if I clear

Performance Benchmarking of Contains, Exists and Any

不想你离开。 提交于 2019-12-17 15:12:50
问题 I have been searching for a performance benchmarking between Contains , Exists and Any methods available in the List<T> . I wanted to find this out just out of curiosity as I was always confused among these. Many questions on SO described definitions of these methods such as: LINQ Ring: Any() vs Contains() for Huge Collections Linq .Any VS .Exists - Whats the difference? LINQ extension methods - Any() vs. Where() vs. Exists() So I decided to do it myself. I am adding it as an answer. Any more

Why does this delay-loop start to run faster after several iterations with no sleep?

左心房为你撑大大i 提交于 2019-12-17 10:34:05
问题 Consider: #include <time.h> #include <unistd.h> #include <iostream> using namespace std; const int times = 1000; const int N = 100000; void run() { for (int j = 0; j < N; j++) { } } int main() { clock_t main_start = clock(); for (int i = 0; i < times; i++) { clock_t start = clock(); run(); cout << "cost: " << (clock() - start) / 1000.0 << " ms." << endl; //usleep(1000); } cout << "total cost: " << (clock() - main_start) / 1000.0 << " ms." << endl; } Here is the example code. In the first 26