benchmarking

MATLAB function is slow the first time, but much faster subsequently. Why?

折月煮酒 提交于 2019-11-28 07:48:48
I have a large MATLAB function file. It first creates a zero matrix, then updates about 70% of the cells by evaluating a number of corresponding (long) algebraic expressions that are hard coded in the function. Once this is complete, a numeric matrix is returned. The .m file is about 4 MB large (I have 100 of these m. files, but that is not directly relevant). When I evaluate the function the first time, it takes about 9 seconds to evaluate. Subsequent runs, however, only take about 0.1 second, which is more what I was expecting. Why does the first evaluation take 9 seconds? Anytime I close

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

馋奶兔 提交于 2019-11-28 07:00:49
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 application, or how to benchmark network protocol. I envision here among others also measuring dependence of

Poor maths performance in C vs Python/numpy

若如初见. 提交于 2019-11-28 06:49:51
问题 Near-duplicate / related: How does BLAS get such extreme performance? (If you want fast matmul in C, seriously just use a good BLAS library unless you want to hand-tune your own asm version.) But that doesn't mean it's not interesting to see what happens when you compile less-optimized matrix code. how to optimize matrix multiplication (matmul) code to run fast on a single processor core Matrix Multiplication with blocks Out of interest, I decided to compare the performance of (inexpertly)

How to set a variable that represents a time in the future in absolute terms Objective-C

你。 提交于 2019-11-28 06:43:42
问题 Motivation: I'm working on an app that makes several (client) phones read audio data from a (server) phone. The idea is that they must all play the song at the exact same time together. Premise: I must figure out a way to make all phones start at a certain time stamp that is absolute (ie it's not relative to the use set clock of either phone etc..).. based on some research I figured the best way to do this is to use CFAbsoluteTimeGetCurrent(); The idea here is that I get the latency it takes

Benchmarking Java programs

十年热恋 提交于 2019-11-28 06:33:55
For university, I perform bytecode modifications and analyze their influence on performance of Java programs. Therefore, I need Java programs---in best case used in production---and appropriate benchmarks. For instance, I already got HyperSQL and measure its performance by the benchmark program PolePosition . The Java programs running on a JVM without JIT compiler. Thanks for your help! P.S.: I cannot use programs to benchmark the performance of the JVM or of the Java language itself (such as Wide Finder). Brent Boyer, wrote a nice article series for IBM developer works: Robust Java

Why is iterating though `std::vector` faster than iterating though `std::array`?

天大地大妈咪最大 提交于 2019-11-28 06:13:53
问题 I recently asked this question: Why is iterating an std::array much faster than iterating an std::vector? As people quickly pointed out, my benchmark had many flaws. So as I was trying to fix my benchmark, I noticed that std::vector wasn't slower than std::array and, in fact, it was quite the opposite. #include <vector> #include <array> #include <stdio.h> #include <chrono> using namespace std; constexpr int n = 100'000'000; vector<int> v(n); //array<int, n> v; int main() { int res = 0; auto

Strategies for timing CUDA Kernels: Pros and Cons?

倖福魔咒の 提交于 2019-11-28 06:11:52
问题 When timing CUDA kernels, the following doesn't work because the kernel doesn't block the CPU program execution while it executes: start timer kernel<<<g,b>>>(); end timer I've seen three basic ways of (successfully) timing CUDA kernels: (1) Two CUDA eventRecords. float responseTime; //result will be in milliseconds cudaEvent_t start; cudaEventCreate(&start); cudaEventRecord(start); cudaEventSynchronize(start); cudaEvent_t stop; cudaEventCreate(&stop); kernel<<<g,b>>>(); cudaEventRecord(stop)

Java regex performance

百般思念 提交于 2019-11-28 05:19:31
问题 I'm trying to parse links with regex with Java. But I think it's getting too slow. For example, to extract all links from: http://news.google.com.ar/nwshp?hl=es&tab=wn ...it's spending 34642 milliseconds (34 seconds!!!) Here is the regex: private final String regexp = "<a.*?\\shref\\s*=\\s*([\\\"\\']*)(.*?)([\\\"\\'\\s].*?>|>)"; The flags for the pattern: private static final int flags = Pattern.CASE_INSENSITIVE | Pattern.DOTALL |Pattern.MULTILINE | Pattern.UNICODE_CASE | Pattern.CANON_EQ;

python: deque vs list performance comparison

夙愿已清 提交于 2019-11-28 05:18:37
In python docs I can see that deque is a special collection highly optimized for poping/adding items from left or right sides. E.g. documentation says: Deques are a generalization of stacks and queues (the name is pronounced “deck” and is short for “double-ended queue”). Deques support thread-safe, memory efficient appends and pops from either side of the deque with approximately the same O(1) performance in either direction. Though list objects support similar operations, they are optimized for fast fixed-length operations and incur O(n) memory movement costs for pop(0) and insert(0, v)

HTTPS vs HTTP speed comparison

我的未来我决定 提交于 2019-11-28 05:16:47
Update 2013-04-25: This is a popular question that is getting more attention than it probably should. In order to stop the spread of misinformation please read the following paragraphs and the accompanying article first: Speed should not be a factor in deciding whether to use HTTPS or HTTP. If you need HTTPS for any part of your site (log-ins, registration, credit cards, etc), you absolutely need HTTPS for all of it , all the time. Please read SSL is not about encryption by Troy Hunt for the reasons why. I'm considered running my entire e-commerce website under https. I decided to run a crude