performance

Java File access - Performance considerations

All, Considering my earlier query Stackoverflow-Post, here is what I am currently doing. This is a kind of flowchart: 1 > Add record to file: a. Get the details for new record b. Retrieve all the records from the file. c. Compare each record retrieved with the new record details. If match found, do not add to the f...

Rotate individual polygons in an Open GL vertex array?

I am working on a game for Android using OpenGL ES, and I have run into a performance problem. What I am trying to do: I have a bunch of objects on screen that all share the same mesh, but all have individual rotations and translations. You could compare it to Asteroids where you have a bunch of asteroids moving around on screen. The a...

Are Java static calls more or less expensive than non-static calls?

Is there any performance benefit one way or another? Is it compiler/VM specific? I am using Hotspot. ...

Convert ascii encoding to int and back again in python (quickly)

I have a file format (fastq format) that encodes a string of integers as a string where each integer is represented by an ascii code with an offset. Unfortunately, there are two encodings in common use, one with an offset of 33 and the other with an offset of 64. I typically have several 100 million strings of length 80-150 to convert ...

Order of ANDS in Where clause for greatest performance

My thinking is that if I put my ANDs that filter out a greater number of rows before those that filter out just a few, my query should run quicker since that selection set is much smaller between And statements. But does the order of AND in the WHERE clause of an SQL Statement really effect the performance of the SQL that much or are t...

would ever passing a variable of an integral type to functions by reference be more efficient than by value?

I know that it's said when passing a variable of any integral type like int, double, long double, etc to a function; it should be done by value but I'm curious that from an assembly point(performance-wise or space-wise), wouldn't be there a situation when passing a variable of an integral type with a size bigger than pointers like long d...

Django request impossibly slow, can't find why

I have an Apache2 + mod_python setup which has begun responding impossibly slow since some days - two seconds of processor time for any request of my app. Some interesting points: Debugbar says it's ~15ms of query time. DB is not the main suspect Logging with datetime.now() shows 0.1s is spent inside the view, and 40ms more are spent i...

Fast algorithm for finding prime numbers?

First of all - I checked a lot in this forum and I haven't found something fast enough. I try to make a function that returns me the prime numbers in a specified range. For example I did this function (in C#) using the sieve of Eratosthenes. I tried also Atkin's sieve but the Eratosthenes one runs faster (in my implementation): public s...

Are algorithm benchmarks in PHP pointless?

As PHP is simpler for me I wished to benchmark algorithms in it for fun, and I chose to do factorials. The recursive function completely flunked in speed when I got up to 80! compared to the iterative method, and it gradually skyrocketed upwards while iterative had a steady line, actually it is something like this (x = factorial, y = se...

Kicking off a Performance Monitor Data Collector Set via PowerShell?

I have a need to kick off a Data Collector Set that I've predefined. I'm going to be writing a PowerShell script that monitors a condition on the system and when it detects that condition, it begins the Data Collector Set. How can I start this Data Collector Set? ...

sql server vs postgres in .net SqlConnection vs NpgsqlConnection

I'm experimenting with postgres and sql server the same query in sql server gives me: CPU time = 31 ms, elapsed time = 800 ms. and in postgres: 38 ms but when I do the same query via .net using SqlConnection,SqlCommand and NpgsqlConnection,NpgsqlCommand the sqlserver is 30% faster can anyone explain this ? ...

Ruby vs Python when building high performance webapp

Hello there I'm building a high performance webapp, it needs a) good team scaling i.e. new team member needs to be able to quickly get started b) good app scaling, so the request load can grow I was thinking between RoR and ruby + postgres vs Python and some framework; I would like to avoid windows server administration and also I had...

How do I benchmark and profile IO bound Perl web application under heavy load?

How do I benchmark (compare two different implementations) and profile (find performance bottlenecks in an implementation) behavior of a web application (in Perl) under heavy load? This webapp is (supposedly) IO bound rather than CPU bound. I'd like to compare proposed implementation (proposed improvement) with current solution, either...

iphone/ipad large canvas vs small canvas + div animation

Since I dont have either of these devices handy to test, which method would be faster on an iphone/ipad? One large canvas (overlayed over a bg of the same size), that is cleared, and has new pixel data drawn to it each frame, at a certain position or A small canvas that updates each frame, contained in a div that is animated across a ...

Handle errors at application or server level?

When setting up asp.net error handlers for things like 404 errors, it is more 'efficient' to do this in IIS, or handle it in the Global.asax Application_Error event? I know the latter will be called, and I want to log this information in a database, but should I then just return without any redirect and let IIS do the redirect, or would ...

How to query specific adapters in Win32_PerfFormattedData_Tcpip_NetworkInterface?

Hi all, The title says it all - how can I query specific adapters (ideally based on the IP address) from Win32_PerfFormattedData_Tcpip_NetworkInterface? I've spent a while googling this issue, but I didn't come up with a solution. I tried using Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration, however, I cannot link these to ...

Does anybody have any experience with FastDB (C++ in-memory database)?

FastDB is an open-source, in-memory database that's tightly integrated with C++ (it supports a SQL-like query language where tables are classes and rows are objects). Like most IMDBs, it's meant for applications dominated by read access patterns. The algorithms and data structures are optimized for systems that read and write data entire...

Any way around awful SecretKeyFactory performance with LVL and AESObfuscator?

I'm looking to use the new licensing (LVL) stuff with Android Marketplace, but I'm running into a performance problem with the stock AESObfuscator. Specifically, the constructor takes several seconds to run on a device (pure agony on emulator). Since this code needs to run to even check for cached license responses, it puts a serious d...

Disabling backreferences in perl

I have been told that disabling backreferences in perl improves performance (provided you're not using them), and that if you don't use any backreferences perl will do this by itself. Now I have a perl script with a large number of regex in it and only a single one uses a backreference and I would like to know the following: Given I h...

High Performance File Manipulation & I/O completion threads

Two questions: I need to make a server that handles potentially thousands of simultaneous requests for: Hashing of files Compression of files Decompression of files Possibly some file copy / moves as well I can't control a customer's hardware (RAID configurations, etc) so I assume all I can do is request hundreds of file operations,...