benchmarking

how to measure time? [duplicate]

半世苍凉 提交于 2019-12-13 04:23:17
问题 This question already has answers here : Resolution of std::chrono::high_resolution_clock doesn't correspond to measurements (3 answers) Closed 5 years ago . I know there are many topics for finding elapse time of a code and I have read many, but i really get confused I decided to use high resolution clock and ran this code to see how many times a second the clock ticks cout << chrono::high_resolution_clock::period::den << endl; output:10000000 and then I defined the begin time and the end

Problems maintaining trivial RPS numbers with jMeter for API testing

試著忘記壹切 提交于 2019-12-13 04:18:38
问题 I am doing API load testing with JMeter. I have a Macbook Air (client) connected with ethernet to a machine being tested with the load (server). I wanted to do a simple test. Hit the server with 5 requests per second (RPS). I create a concurrency thread group with 60 threads, a throughput shaping timer with 5 RPS for one minute, my HTTP request and hit the play button and run the test. I expect to see my Hits per Second listener indicating a flat line of 5 hits per second, instead I see a

OptaPlanner benchmarking without XML inputSolutionFile

青春壹個敷衍的年華 提交于 2019-12-12 22:03:24
问题 I have developed a working solver, which generates the unsolved solution directly from database(without and XML file). Now I am starting to develop it's benchmarker. Since all the example benchmarkers utilizes inputSolutionFile(xml files), I am trying to get the unsolved solution I generated into the PlannerBenchmarkFactory. Am I able to bypass creating the xml inputSolutionFile? If not, how would I serialize the unsolved solution into an acceptable inputSolutionFile? 回答1: One way that should

Faster implementation for reduceByKey on Seq of pairs possible?

馋奶兔 提交于 2019-12-12 18:42:02
问题 The code below contains various single-threaded implementations of reduceByKeyXXX methods and a few helper methods to create input sets and measure execution times. (Feel free to run the main -method) The main purpose of reduceByKey (as in Spark) is to reduce key-value-pairs with the same key. Example: scala> val xs = Seq( "a" -> 2, "b" -> 3, "a" -> 5) xs: Seq[(String, Int)] = List((a,2), (b,3), (a,5)) scala> ReduceByKeyComparison.reduceByKey(xs, (x:Int, y:Int) ⇒ x+y ) res8: Seq[(String, Int)

Optimize a “mask” function in Matlab

断了今生、忘了曾经 提交于 2019-12-12 15:13:17
问题 For a benchmark comparison, I consider the simple function: function dealiasing2d(where_dealiased, data) [n1, n0, nk] = size(data); for i0=1:n0 for i1=1:n1 if where_dealiased(i1, i0) data(i1, i0, :) = 0.; end end end It can be useful in pseudo-spectral simulations (where data is a 3d array of complex numbers) but basically it applies a mask to a set of images, putting to zeros some elements for which where_dealiased is true. I compare the performance of different languages (and

Why does .toString() seem to fix an OutOfMemoryError exception for StringBuilder?

筅森魡賤 提交于 2019-12-12 14:42:44
问题 I am learning how to microbenchmark things with JMH. I started with something seemingly simple: string concatenation for StringBuilder vs String += . From my understanding, I should make a State object that contains an instance of StringBuilder because I don't want to benchmark its constructor (nor do I want to an empty one every iteration anyway). Same goes for the String += test - I want a String object in my State to be concatenated with new strings. This is my code: @State(Scope.Thread)

Benchmarking runtime of ajax requests

一个人想着一个人 提交于 2019-12-12 13:20:44
问题 I am encountering a strange problem, and most likely I do not understand something correctly. I have a website, which uses ajax requests to load different pages, to make it more application like. I've noticed that the page load times, are rather high (1-3 seconds), and wanted to benchmark it, to notice where the problem is coming from. I was using Firefox's Developer Tools, and the Networking tab. When I clicked on my link, to load the page with the ajax request, I was checking the developer

How to specify the command line when using Caliper?

旧巷老猫 提交于 2019-12-12 12:34:45
问题 I find Google's micro benchmark project Caliper very interesting but the documentation is still (except some examples) quite non-existent. I have two different cases where I need to influence the command line of the JVMs Caliper starts: I need to set some fixed (ideally alternated between a few fixed values) -D parameters I need to specify some fixed (ideally alternated between a few fixed values) JVM parameters I saw some discussion about adding features like this but I could not conclude if

what does STREAM memory bandwidth benchmark really measure?

喜欢而已 提交于 2019-12-12 12:19:34
问题 I have a few questions on STREAM (http://www.cs.virginia.edu/stream/ref.html#runrules) benchmark. Below is the comment from stream.c. What is the rationale about the requirement that arrays should be 4 times the size of cache? * (a) Each array must be at least 4 times the size of the * available cache memory. I don't worry about the difference * between 10^6 and 2^20, so in practice the minimum array size * is about 3.8 times the cache size. I originally assume STREAM measures the peak memory

Verify JMH measurements of simple for/lambda comparisons

早过忘川 提交于 2019-12-12 09:41:15
问题 I wanted to do some performance measurements and comparisons of simple for loops and equivalent streams implementations. I believe it's the case that streams will be somewhat slower than equivalent non-streams code, but I wanted to be sure I'm measuring the right things. I'm including my entire jmh class here. import java.util.ArrayList; import java.util.List; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup;