benchmarking

Create quick/reliable benchmark with java?

落花浮王杯 提交于 2019-11-26 11:29:40
问题 I\'m trying to create a benchmark test with java. Currently I have the following simple method: public static long runTest(int times){ long start = System.nanoTime(); String str = \"str\"; for(int i=0; i<times; i++){ str = \"str\"+i; } return System.nanoTime()-start; } I\'m currently having this loop multiple times within another loop that is happening multiple times and getting the min/max/avg time it takes to run this method through. Then I am starting some activity on another thread and

Slow AES GCM encryption and decryption with Java 8u20

拈花ヽ惹草 提交于 2019-11-26 11:08:18
问题 I am trying to encrypt and decrypt data using AES/GCM/NoPadding. I installed the JCE Unlimited Strength Policy Files and ran the (simple minded) benchmark below. I\'ve done the same using OpenSSL and was able to achieve more than 1 GB/s encryption and decryption on my PC. With the benchmark below I\'m only able to get 3 MB/s encryption and decryption using Java 8 on the same PC. Any idea what I am doing wrong? public static void main(String[] args) throws Exception { final byte[] data = new

Is there any simple way to benchmark python script?

爷,独闯天下 提交于 2019-11-26 10:06:35
问题 Usually I use shell command time . My purpose is to test if data is small, medium, large or very large set, how much time and memory usage will be. Any tools for linux or just python to do this? 回答1: Have a look at timeit, the python profiler and pycallgraph. timeit def test(): """Stupid test function""" lst = [] for i in range(100): lst.append(i) if __name__ == '__main__': import timeit print(timeit.timeit("test()", setup="from __main__ import test")) Essentially, you can pass it python code

How efficient can Meteor be while sharing a huge collection among many clients?

白昼怎懂夜的黑 提交于 2019-11-26 10:06:33
问题 Imagine the following case: 1,000 clients are connected to a Meteor page displaying the content of the \"Somestuff\" collection. \"Somestuff\" is a collection holding 1,000 items. Someone inserts a new item into the \"Somestuff\" collection What will happen: All Meteor.Collection s on clients will be updated i.e. the insertion forwarded to all of them (which means one insertion message sent to 1,000 clients) What is the cost in term of CPU for the server to determine which client needs to be

Why is apply() method slower than a for loop in R?

假装没事ソ 提交于 2019-11-26 09:33:39
问题 As a matter of best practices, I\'m trying to determine if it\'s better to create a function and apply() it across a matrix, or if it\'s better to simply loop a matrix through the function. I tried it both ways and was surprised to find apply() is slower. The task is to take a vector and evaluate it as either being positive or negative and then return a vector with 1 if it\'s positive and -1 if it\'s negative. The mash() function loops and the squish() function is passed to the apply()

Benchmarking VBA Code

此生再无相见时 提交于 2019-11-26 09:25:06
问题 What is considered the most accurate way to benchmark VBA code (in my case, I am testing code in Excel)? Are there any other techniques for benchmarking code besides the 2 below, and if so, what are the pros/cons of the method? Here are 2 popular methods. First: Timer Sub TimerBenchmark() Dim benchmark As Double benchmark = Timer \'Do your code here MsgBox Timer - benchmark End Sub And Tick (which I see argued as the most accurate): Option Explicit Private Declare Function GetTickCount Lib \

SQLite Performance Benchmark — why is :memory: so slow…only 1.5X as fast as disk?

五迷三道 提交于 2019-11-26 09:22:26
问题 Why is :memory: in sqlite so slow? I\'ve been trying to see if there are any performance improvements gained by using in-memory sqlite vs. disk based sqlite. Basically I\'d like to trade startup time and memory to get extremely rapid queries which do not hit disk during the course of the application. However, the following benchmark gives me only a factor of 1.5X in improved speed. Here, I\'m generating 1M rows of random data and loading it into both a disk and memory based version of the

How can I benchmark JavaScript code? [closed]

ぃ、小莉子 提交于 2019-11-26 09:15:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Is there a package that helps me benchmark JavaScript code? I\'m not referring to Firebug and such tools. I need to compare 2 different JavaScript functions that I have implemented. I\'m very familiar with Perl\'s Benchmark (Benchmark.pm) module and I\'m looking for something similar in JavaScript. Has the

LINQ Ring: Any() vs Contains() for Huge Collections

ぐ巨炮叔叔 提交于 2019-11-26 09:01:19
问题 Given a huge collection of objects, is there a performance difference between the the following? Collection.Contains: myCollection.Contains(myElement) Enumerable.Any: myCollection.Any(currentElement => currentElement == myElement) 回答1: Contains() is an instance method, and its performance depends largely on the collection itself. For instance, Contains() on a List is O(n), while Contains() on a HashSet is O(1). Any() is an extension method, and will simply go through the collection, applying

Why is Skylake so much better than Broadwell-E for single-threaded memory throughput?

。_饼干妹妹 提交于 2019-11-26 08:52:04
We've got a simple memory throughput benchmark. All it does is memcpy repeatedly for a large block of memory. Looking at the results (compiled for 64-bit) on a few different machines, Skylake machines do significantly better than Broadwell-E, keeping OS (Win10-64), processor speed, and RAM speed (DDR4-2133) the same. We're not talking a few percentage points, but rather a factor of about 2 . Skylake is configured dual-channel, and the results for Broadwell-E don't vary for dual/triple/quad-channel. Any ideas why this might be happening? The code that follows is compiled in Release in VS2015,