performance

Is performing a count() calculation slowing down my mysql query?

I'm still learning about MySQL. I may be making a very basic error, and I'm prepared to be chastened here... What this query is trying to do is select the top members from our website based on a count of the number of book and recipe reviews they have made. I'm making a calculation of the total in the SQL query itself. The query is s...

Which ASP.NET Page event is the best place for this type of code?

I have a relatively simple page that will do most of its operations on the client side using Javascript or JQuery. However, initially I do need to retrieve some data from the DB server based on QueryString parameters. I plan on passing this data in the form of a JSON string to the script by an old-fashioned ASP manner ( var severData...

Fluent NHibernate Mapping test takes forever

I've recently started to learn Fluent NH, and I'm having some trouble with this test method. It takes forever to run (it's been running for over ten minutes now, and no sign of progress...). [TestMethod] public void Entry_IsCorrectlyMapped() { Action<PersistenceSpecification<Entry>> testAction = pspec => pspec ...

Memory footprint of an app on iPhone

I recently had an app rejected from the app store because of Low Memory Exception. The app doesn't leak memory, but its base memory footprint seems to be too high. According to the crash logs sent by apple, it was taking about 14000 pages in the memory (mostly due to huge textures). There were 2 strange things though: I tested it on 5 ...

any one know how to convert a huge char array to float, very huge array, performance better than the atof/strtod/sscanf

I got a char array, a huge array char p[n] read from a txt like. //1.txt 194.919 -241.808 234.896 195.569 -246.179 234.482 194.919 -241.808 234.896 ... foo(char *p, float x, float y, float z) { } I tried to use atof, strtod, but they are real time consuming when the array is too huge, because they will call the strlen(). and the s...

Passing IEnumerable across appdomain boundaries

Is it generally a bad idea to pass an IEnumerable across appdomain boundaries? I ask because with my current understanding of IEnumerable implementations, the enumerator isn't going to be used until the collection is, well, enumerated. When you are crossing appdomain boundaries, particularly involving multiple processes, would this not...

Site on OpenGL call performance

I'm searching for reliable data on OpenGL's functions performance. A site that could for example: ...answer me how much more efficient is using glInterleavedArrays compared to gl*Pointer based implementation with strides, or without them. If applicable, show the comparisions on nVidia vs. ATI cards vs. embedded systems. ...answer me ho...

severside processing vs client side processing + ajax?

looking for some general advice and/or thoughts... i'm creating what i think to be more of a web application then web page, because i intend it to be like a gmail app where you would leave the page open all day long while getting updates "pushed" to the page (for the interested i'm using the comet programming technique). i've never cr...

SQL Server query freezes when I use "where"

I'm using SQL Server 2005 Express, and I'm running into a strange issue. I have a table called "DailyPrice" that has about 24 million records (I was able to make this table thanks to all your help in this thread: http://stackoverflow.com/questions/1983611/sql-server-2005-slows-down-as-i-keep-adding-rows) Now, I'm running a different fan...

SQL Azure and READ_COMMITTED_SNAPSHOT

I would like to set READ_COMMITTED_SNAPSHOT to ON on my SQL Azure database, but the following code, which works with other versions of SQL Server, is not supported in Azure: ALTER DATABASE [database_name] SET READ_COMMITTED_SNAPSHOT ON GO First question: Is it still a good idea to set READ_COMMITTED_SNAPSHOT to ON in SQL Azure (or wha...

Actionscript 3 freeing class variables

Suppose I have a class structure like the following, where I have a temporary child that is displayed and later replaced and as such no longer needed. However as multiple methods access that child before, I need it to be a class variable. So after replacing that child, I no longer need it and want to allow the garbage collection to reus...

Caching lightweight data.

Hi What is the point of caching a one row of data, especially if it will probably needed once or twice on its life time. Or I should cache everything. and why? Thanks ...

Reading file over network slow due to extra reads

I'm reading a file and I either read a row of data (1600 sequential reads of 17 bytes) or a column of data (1600 reads of 17 bytes separated by 1600*17=27,200 bytes). The file is either on a local drive or a remote drive. I do the reads 10 times so I expect in each case to read in 272,000 bytes of data. On the local drive, I see what ...

Improve cufon font performance on iPhone?

I'm using the Cufon font replacement tool on iPhone. Unfortunately, it's really slow there. (On a small 50 word page it takes about 2 seconds on my first-gen iPhone.) Are there any optimizations I can make to improve performance? (If you have multiple tips, please split them out into multiple answers so they can be voted up separatel...

Starting processes at same time is slower than staggering; why?

I'm evaluating the performance of an experimental system setup on an 8-core machine with 16GB RAM. I have two main-memory Java RDBMSs (hsqldb) running, and against each of these I run a TPCC client (derived from jTPCC/BenchmarkSQL). I have scripts to launch things, so e.g. the hsqldb instances are started with: ./hsqld.bash 0 & ./hsqld...

Poor boost.ASIO performance.

I have a very simple server/client performance test using boost::asio on Windows and it seems to be performing really poorly. I'm hoping that I'm just using the library incorrectly and would appreciate any advice. I have a session class that writes a message-length and then writes a message, and then waits to read a message-length and ...

Fastest way to find out minimum of 3 numbers?

In a program I wrote, 20% of the time is being spent on finding out the minimum of 3 numbers in an inner loop, in this routine: static inline unsigned int min(unsigned int a, unsigned int b, unsigned int c) { unsigned int m = a; if (m > b) m = b; if (m > c) m = c; return m; } Is there any way to speed this up? I am ok ...

What statistics should a programmer (or computer scientist) know?

I'm a programmer with a decent background in math and computer science. I've studied computability, graph theory, linear algebra, abstract algebra, algorithms, and a little probability and statistics (through a few CS classes) at an undergraduate level. I feel, however, that I don't know enough about statistics. Statistics are increasin...

If 256 threads give better performance than 8 have I likely got the wrong approach?

I've just started programming with POSIX threads on dual-core x86_64 Linux system. It seems that 256 threads is about the optimum for performance with the way I've done it. I'm wondering how this could be? And if it could mean that my approach is wrong and a better approach would require far fewer threads and be just as fast or faster? ...

Sorting Float Column vs Int Column in SQL Server

I wonder if type of a column matters in terms of sorting performance. I have heard that int columns are sorted faster than float columns. Do you think it is correct? ...