benchmarking

Obtaining CPU thread usage in Java

一曲冷凌霜 提交于 2019-11-30 13:19:17
I have a question around getting CPU utilization for a given JNI block. I'm making some intensive CPU computation in the underlying C++ JNI native method. I'm in the process of optimizing this computation and want to benchmark it against varying inputs. I need some guidance on how to go about measuring this. The alternatives I have considered so far are Using JMX ThreadMXBean to measure system CPU usage for the current thread that invokes call into JNI method. However, I am not sure if JNI code is executed within the invoking thread context. What happens when the thread spawns more threads?

Slow performance for deeply nested subquery factoring (CTE)

喜夏-厌秋 提交于 2019-11-30 13:17:59
This query consists of 16 equal steps. Every step is doing the same calculation on the same dataset (a single row), but last steps take too much time for it. with t0 as (select 0 as k from dual) ,t1 as (select k from t0 where k >= (select avg(k) from t0)) ,t2 as (select k from t1 where k >= (select avg(k) from t1)) ,t3 as (select k from t2 where k >= (select avg(k) from t2)) ,t4 as (select k from t3 where k >= (select avg(k) from t3)) ,t5 as (select k from t4 where k >= (select avg(k) from t4)) ,t6 as (select k from t5 where k >= (select avg(k) from t5)) ,t7 as (select k from t6 where k >=

MySQL Benchmark

余生颓废 提交于 2019-11-30 12:20:03
I am trying to use MySQL benchmark to test some queries. But, I am running to an error. SELECT benchmark (10000, (select title from user)); and in return I get this error; ERROR 1242 (21000): Subquery returns more than 1 row Does anyone know how to benchmark a query? Thanks select title from user This returns multiple rows, which won't work. Refer to this link: http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_benchmark The expression you pass must return a scalar result. You need to change the query such that it returns a single row: ex: select title from user where

Benchmarking programs in Rust

空扰寡人 提交于 2019-11-30 11:18:10
问题 How is it possible to benchmark programs in Rust? For example, how would I get execution time of program in seconds? 回答1: This answer is outdated! Please see the answers below for up to date information. You might try timing individual components within the program using the time crate. 回答2: It might be worth noting 2 years later (to help any future Rust programmers who stumble on this page) that there are now tools to benchmark Rust code as a part of one's test suite. (From the guide link

How to benchmark memory usage of a function?

筅森魡賤 提交于 2019-11-30 11:11:40
I notice that Rust's test has a benchmark mode that will measure execution time in ns/iter , but I could not find a way to measure memory usage. How would I implement such a benchmark? Let us assume for the moment that I only care about heap memory at the moment (though stack usage would also certainly be interesting). Edit: I found this issue which asks for the exact same thing. With Rust 1.0 and 1.1 you could use the libc crate in order to print the jemalloc statistics: #![feature(libc)] extern crate libc; use libc::*; extern {fn je_malloc_stats_print (write_cb: extern fn (*const c_void,

Vector vs Array Performance

女生的网名这么多〃 提交于 2019-11-30 09:18:34
In another thread I started a discussion about Vectors and Arrays, in which I was largely playing devil's advocate, to push buttons. However, during the course of this, I stumbled onto a test case that has me a little perplexed, and I would like to have a real discussion about it, over the "abuse" I'm getting for playing devil's advocate, starting a real discussion on that thread is now impossible. However, the particular example has me intrigued, and I cannot explain it to myself satisfactorily. The discussion is about the general performance of Vector vs Arrays, ignoring dynamic elements. Ex

Are jQuery's :first and :eq(0) selectors functionally equivalent?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 07:56:08
问题 I'm not sure whether to use :first or :eq(0) in a selector. I'm pretty sure that they'll always return the same object, but is one speedier than the other? I'm sure someone here must have benchmarked these selectors before and I'm not really sure the best way to test if one is faster. Update: here's the bench I ran: /* start bench */ for (var count = 0; count < 5; count++) { var i = 0, limit = 10000; var start, end; start = new Date(); for (i = 0; i < limit; i++) { var $radeditor = $thisFrame

Has anyone done a performance analysis of boost::asio?

蹲街弑〆低调 提交于 2019-11-30 06:43:55
I require socket-like local IPC. I used named pipes and overlapped IO on windows and I want to rewrite the application to boost::ASIO so that it can use UNIX domain sockets as well. I've recently reviewed parts of the libevent library and I know it only supports socket() and select() for windows in the 1.4 version. As overlapped IO is very efficient leaving it out is obviously an unacceptable trait which is being adressed in version 2 (which is in alpha). Another example of sub-optimal implementation is the use of red-black trees vs. prio-queues for the timeout logic which was adressed

data.table time subset vs xts time subset

爷,独闯天下 提交于 2019-11-30 05:51:44
问题 Hi I am looking to subset some minutely data by time. I normally use xts doing something like: subset.string <- 'T10:00/T13:00' xts.min.obj[subset.string] to get all the rows which are between 10am and 1pm (inclusive) EACH DAY and have the output as an xts format. But is a bit slow for my purposes...e.g j <- xts(rnorm(10e6),Sys.time()-(10e6:1)) system.time(j['T10:00/T16:00']) user system elapsed 5.704 0.577 17.115 I know that data.table is v fast and at subsetting large datasets so am

Is the Julia language really as fast as it claims?

大城市里の小女人 提交于 2019-11-30 05:36:31
Following this post I decided to benchmark Julia against GNU Octave and the results were inconsistent with the speed-ups illustrated in julialang.org . I compiled both Julia and GNU Octave with CXXFLAGS='-std=c++11 -O3' , the results I got: GNU Octave a=0.9999; tic;y=a.^(1:10000);toc Elapsed time is 0.000159025 seconds. tic;y=a.^(1:10000);toc Elapsed time is 0.000162125 seconds. tic;y=a.^(1:10000);toc Elapsed time is 0.000159979 seconds. -- tic;y=cumprod(ones(1,10000)*a);toc Elapsed time is 0.000280142 seconds. tic;y=cumprod(ones(1,10000)*a);toc Elapsed time is 0.000280142 seconds. tic;y