Is it possible to force an existing Java application to use no more than x cores?

It’s called setting CPU affinity, and it’s an OS setting for processes, not specific to Java. On Linux: http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html On Windows: http://www.addictivetips.com/windows-tips/how-to-set-processor-affinity-to-an-application-in-windows/ On Mac it doesn’t look like you can set it: https://superuser.com/questions/149312/how-to-set-processor-affinity-on-os-x

Create quick/reliable benchmark with java?

In short: (Micro-)benchmarking is very complex, so use a tool like the Benchmarking framework http://www.ellipticgroup.com/misc/projectLibrary.zip – and still be skeptical about the results (“Put micro-trust in a micro-benchmark”, Dr. Cliff Click). In detail: There are a lot of factors that can strongly influence the results: The accuracy and precision of System.nanoTime: it is in the … Read more

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

The short answer is that only new data gets sent down the wire. Here’s how it works. There are three important parts of the Meteor server that manage subscriptions: the publish function, which defines the logic for what data the subscription provides; the Mongo driver, which watches the database for changes; and the merge box, … Read more

Why is json.loads an order of magnitude faster than ast.literal_eval?

The two functions are parsing entirely different languagesā€”JSON, and Python literal syntax.* As literal_eval says: The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, booleans, and None. JSON, by contrast, only handles double-quoted JavaScript string literals (not quite identical to Python’s**), JavaScript numbers … Read more

Benchmarking VBA Code

The following code uses a windows function that is more accurate than Excel. It is taken from http://msdn.microsoft.com/en-us/library/aa730921.aspx#Office2007excelPerf_MakingWorkbooksCalculateFaster. The same page also contains some great tips on improving performance in Excel 2007. Private Declare Function getFrequency Lib “kernel32” _ Alias “QueryPerformanceFrequency” (cyFrequency As Currency) As Long Private Declare Function getTickCount Lib “kernel32” _ Alias “QueryPerformanceCounter” … Read more

Python Requests vs PyCurl Performance

I wrote you a full benchmark, using a trivial Flask application backed by gUnicorn/meinheld + nginx (for performance and HTTPS), and seeing how long it takes to complete 10,000 requests. Tests are run in AWS on a pair of unloaded c4.large instances, and the server instance was not CPU-limited. TL;DR summary: if you’re doing a … Read more

tech