performance

In Java: is where a way to create a subarray that will point to a portion of a bigger array?

Learning Java, so be gentle please. Ideally I need to create an array of bytes that will point to a portion of a bigger array: byte[] big = new byte[1000]; // C-style code starts load(file,big); byte[100] sub = big + 200; // C-style code ends I know this is not possible in Java and there are two work-arounds that come to mind and...

Log query before executing it.

Hi, I've run into a problem where I run some query and the mysqld process starts using 100% CPU power, without ending. I want to pinpoint this query. The problem is that log/development.log contains only queries that have finished. Any idea? ...

Java real-time service monitoring framework

Got to create some kind of "counters" for online service monitoring - i.e. Foo_Request_Total, Foo_Request_DB_error, Foo_Request_Timedout, Bar_Request_Total,... Also, some kind of alarm has to be generated when counter passes a pre-defined limit (for example SNMP trap if more than 5 requests per hour were timed out). Could you suggest ...

Will python provide enough performance for a proxy?

I want to start writing a http proxy that will modify responses according to some rules/filters I will configure. However, before I start coding it, I want to make sure I'm making the right choice in going with Python. Later, this tool would have to be able to process a lot of requests, so, I would like to know I can count on it later on...

What influences the speed of code?

The way to see how fast your code is going, is performance profiling. There are tools for it and such, but I wonder what the factors are for code speed. For instance, I've been told that image-editting software will use bitwise operations instead of integer variables to calculate their stuff, simply because it's faster. So that must me...

DLL Number and Load Performance

Suppose the overall dll size is 100M, here are the 2 cases: 100M * 1 10M * 10 Will their be much performance impact when using many small sized DLLs? why? We did a testing recently but didn't detect much performance difference between the 2 cases, I am not sure if there are some wrong steps with my testing or this is the fact. ...

How to reduce CPU usage of a program?

I wrote a multi-threaded program which does some CPU heavy computation with a lot of floating point operations. More specifically, it's a program which compares animation sequences frame by frame. I.e. it compares frame data from animation A with all the frames in animation B, for all frames in animation A. I carry out this intensive ope...

Open source solution stack for high performance web site?

If you had been given the task to recommend an open source solution stack for a web site where scalable high performance is prioritized above everything else, what would you recommend? Some attempts at definitions: Scalability: when deployed, the solution stack should be able to scale from a handful of users to several millions by si...

Customization hooks: virtual functions or events?

Performance and Design wise what would be the pros and cons Using a sealed class and events or using a abstract class with a virtual function? there will only be one listener to the events... ...

Is it possible to speed up a recursive file scan in PHP?

I've been trying to replicate Gnu Find ("find .") in PHP, but it seems impossible to get even close to its speed. The PHP implementations use at least twice the time of Find. Are there faster ways of doing this with PHP? EDIT: I added a code example using the SPL implementation -- its performance is equal to the iterative approach ED...

Impact on performance using ASP.NET Controls

With user controls on a page, I understand that every control has an impact on memory usage by storing their own state in ViewState. My question is, how much? For example - I have a feedback form as a control on my masterpage. It is set to Visible="false" by default. A user clicks on a feedback button, and the control becomes visible wh...

What is the fastest way to read a large number of small files into memory ?

I need to read ~50 files on every server start and place each text file's representation into memory. Each text file will have its own string (which is the best type to use for the string holder?). What is the fastest way to read the files into memory, and what is the best data structure/type to hold the text in so that I can manipulate...

performance implications of filtering by a small set of ID's in a Where clause

Hi, I have a table with millions of rows in it. I want to add an Integer column (indexed) that is going to hold between 1-1000 unique values (in most situations probably less than 30). Will query performance be degraded substantially if my queries look like: SELECT * FROM MyTable WHERE GroupID IN (1, 123, 20, 30, 40) ...

HashSet performance Add vs Contains for existing elements

Frustratingly this question just got closed: So I will put it here in its correct form: For some reason, it seems the Add operation on a HashSet is slower than the Contains operation when the element already exists in the HashSet. Here is proof: Stopwatch watch = new Stopwatch(); int size = 10000; int iterations = 100...

Efficient update of MySQL table from SQL Server

We have a MySQL database (mostly read-only, so MyISAM tables) living in the data center that talks to a SQL Server DB living on-site. There is some significant latency in the WAN (upwards of 100ms); in about 6 months the SQL Server DBMS will be moving up to the data center (e.g. same gigabit LAN). In the MySQL DB, I have several thousan...

Performance Advantages to Iterators?

What (if any) performance advantages are offered by using iterators. It seems like the 'Right Way' to solve many problems, but does it create faster/more memory-conscious code? I'm thinking specifically in Python, but don't restrict answers to just that. ...

Does more data mean slower queries?

Let's say I have one table that has 1000 rows and the other table with the same structure/index but 10 million records. Will the performance of CRUD operations on the bigger table be slower than the smaller one? Thanks. ...

Ressource usage when storing a vast stream of data into a database

First of all, i don't have much of a clue about databases, so please forgive me if this is a stupid question. My company is receiving a torrent of positional data via TCP. Each packet consists of a few floats and a timestamp. Our task is to store the data into a database (MS SQL Server 2005), running on a modern PC. Each blob has about...

Programmatically getting per-process network statistics on Windows?

I'd like to find out which processes are using my network. This is quite easy in Linux, but I'm stumped as to how to do this in Windows. Essentially, I'd like, for each process, to know how many bytes it has read/written to the network over a time period. If I could know IP addresses/port numbers, etc., that would be awesome. Any point...

Improving Comparable<T> compareTo performance

I profiled my code and found out that my class, which implements Comparable<T>, spends 8x more cpu time in compareTo(Object) than in compareTo(T) I assume that the slowdown is because of virtual table lookup for this method. Is there a way to force static invocation of the function? (like in non virtual C++ methods) I still wa...