performance

Performance counters incrementing improperly?

Probably a rookie error, but i'm getting something strange. i'm trying to weave a .NET performance counter into an application. When i call the incrementBy(value) method on my avg performance counter it is changing the RawValue of my base counter by value as well. i checked the variable names and think everything is correct. Then when...

Is there a standard mysql connection pooling library for C?

I have a C application using the MySQL library for database access. Is there a standard way to implement database connection pooling for such an application? The C connector doesn't appear to support it. ...

appengine: cached reference property?

How can I cache a Reference Property in Google App Engine? For example, let's say I have the following models: class Many(db.Model): few = db.ReferenceProperty(Few) class Few(db.Model): year = db.IntegerProperty() Then I create many Many's that point to only one Few: one_few = Few.get_or_insert(year=2009) Many.get_or_inser...

How can I quickly insert a BLOB in PostgreSQL?

What is your advice on configuring PostgreSQL such that BLOB can be written quickly? We are using PostgreSQL to insert BLOB at a high rate. We call a lo_write() roughly 220 times a second. We write roughly 30KB of binary data per lo_write(). This is equivalent to roughly 6 MB/s. Our computer is RAID-5, so the write speed is in the n...

jquery script is using to much memory

I have the code below on a social network site, it loads a file that shows users new notification messages if they exist. Problem is when I leave the page open for a while, it eventually consumes too much memory on my PC and starts to make firefox non-responsive and throws an error message saying that memory is getting low and asking if...

what are my options as my mysql DB grows

How could I improve this query? Please tell me all my options here as my social network DB is only getting bigger This Query took 2.1231 sec SELECT friend_friend.friendid, friend_reg_user.disp_name, friend_reg_user.pic_url, friend_reg_user.online FROM friend_friend INNER JOIN friend_reg_user ON friend_friend.friendid = friend_reg_user...

MS Access 2003 + linked tables to SQL Server 2005 + Windows Authentication = slow

Our MS Access application with linked tables to SQL Server 2005 is slow when using Windows Authentication from Windows XP clients. We've been running it successfully using SQL Server authentication, but now we want to move to Windows Authentication for better security control. Setup: Database server: Windows 2003 Server, SQL Server...

Cross DB stored procedures performance in SQL Server 2008

Let's have: $DB an SQL Server database $DBSP1 an SQL Server database containing stored procedures referencing $DB $DBSP2 is exactly like $DBSP1 $SP is a stored procedure Running $SP on $DBSP1 from C# code takes around 1.5s. Running $SP on $DBSP2 from C# code takes around 0.5s. The C# code is very simple and use SqlClient with defau...

Datareader or Dataset in Winform with long trips to database?

I've got a Winform app that will be used in the US and China. The SQL Server 2005 database is in the US, so the data access is going to be slower for the people in China. I'm deciding between using a DataReader and a Dataset for best performance. The data will immediately be loaded into business objects upon retrieval. Question: Which p...

Regex implementation that can handle machine-generated regex's: *non-backtracking*, O(n)?

Edit: This question has considerably evolved since I first asked it. See below for two fast+compatible, but not completely fully featured implementations. If you know of more or better implementations, please mention them, there still isn't an ideal implementation here yet! Where can I find reliably fast Regex implementation? Does ...

Websphere Application Server - What on earth will it take to start any fast!!?

I am using Rational Application Developer v7.0 that ships with an integrated test environment. When I get to debugging my webapp, the server startup time in debug mode is close to 5-6 minutes - enough time to take a coffe break! At times, it so pisses me off that I start cursing IBM for building an operating system! instead of an app s...

Profiling Native C++ WinCE App Built with Visual Studio 2008

I've got a native C++ application that I need to profile to diagnose performance issues. The only profiler I can find for WinCE is the Remote Call Profiler, which requires the application be built with the Platform Builder so the instrumentation hooks can be compiled in. My application is built with VS2008. Any suggestions? ...

SQL Efficiency: WHERE IN Subquery vs. JOIN then GROUP

As an example, I want to get the list of all items with certain tags applied to them. I could do either of the following: SELECT Item.ID, Item.Name FROM Item WHERE Item.ID IN ( SELECT ItemTag.ItemID FROM ItemTag WHERE ItemTag.TagID = 57 OR ItemTag.TagID = 55) Or SELECT Item.ID, Item.Name FROM Item LEFT JOIN ItemTag ON It...

Multiple SQL searches vs searching through one returned array

Is it faster to do multiple SQL finds on one table with different conditions or to get all the items from the table in an array and then separate them out that way? I realize I'm not explaining my question that well, so here is an example: I want to pull records on posts and display them in categories based on when they were posted, sa...

large sql resultsets in java

How can I fetch large resultset in java? I have about 140,000 rows with 3 columns. ...

Performance creating multiple small files

Hi, I need a test app that will create a big number of small files on disk as faster as possible. Will asynch ops help creating files or just writing them? Is there a way to speed up the whole process (writing on a single file is not possible) ...

JavaScript "classes"

Are there any downsides to using a JavaScript "class" with this pattern? var FooClass = function() { var private = "a private variable"; this.public = "a public variable"; var privatefn = function() { ... }; this.publicfn = function() { ... }; }; var foo = new FooClass(); foo.public = "bar"; foo.publicfn(); ...

How to interpret iostat?

I track a lot of parameters on my Server and the only thing I can't realy put in perspective is the IOstat. It is a MySQL Server, is this a good result, or should I worry? root:/var/lib/mysql# iostat -xc Linux 2.6.28-11-server () 07/25/2009 _x86_64_ (8 CPU) avg-cpu: %user %nice %system %iowait %steal %idle ...

Java Performance - ArrayLists versus Arrays for lots of fast reads.

I have a program where I need to make 100,000 to 1,000,000 random-access reads to a List-like object in as little time as possible (as in milliseconds) for a cellular automata-like program. I think the update algorithm I'm using is already optimized (keeps track of active cells efficiently, etc). The Lists do need to change size, but tha...

in which situations does it make sense to create only an lighteight CALayer rather than a fat UIView?

The only thing that comes in my mind is displaying simple images. But that wouldn't make sense if you want to animate them, right? So is it any useful to make a CALayer only instead of an UIView that comes along with a whole bunch of them (all those trees...)? ...