Possible Duplicate:
Difference between declaring variables before or in loop?
Is there any (or any notable) performance difference when I write for example something like this (consider loading tens or hundreds of thousands rows from DB into the collection of Foo objects):
...
Foo myFoo;
while(reader.Read())
{
myFoo = new ...
Hi,
I am looking to understand conceptually what all goes in profiling a ruby or ruby on rails program (e.g. memory usage, speed of request dispatching, speed of connecting with external programs like DB) and what are the best tools (at a conceptual and fundamental level) that are available
Thanks
...
An application our company is working on currently displays many rectangle shapes with gradients to draw 'Tiles'. An internal discussion came about that posed a question of performance. These tiles are about 100 pixels by 200 pixels, and are either gradient shaded red, yellow, or green. At any given time, there could be up to 100 of thes...
I have an app that will need to cache some images.
I have read some documentation about caching, and the logical thing to do is to cache my images within the Library/Caches directory within my app's sandbox.
I understand that the reason for storing caches images here are:
Library/Caches isn't backed up by iTunes
Library/Caches is cle...
Given a scenario where there are millions of potentially overlapping bounding boxes of variable sizes less the 5km in width.
Create a fast function with the arguments findIntersections(Longitude,Latitude,Radius) and the output is a list of those bounding boxes ids where each bounding box origin is inside the perimeter of the function ar...
Hi,
I have a pretty complex object and I need to get uniqueness of these objects. One solution can be done by overriding GetHashCode(). I have implemented a code noted below:
public override int GetHashCode()
{
return this._complexObject1.GetHashCode() ^
this._complexObject2.GetHashCode() ^
this._complexObject...
After IIS reset, first hit taking a long time because AppPool is starting and other .NET components, DB connections are initializing.
What would be the best way to warm up IIS applications and preload required components (e.g. GAC Assemblies, WCF, WWF libraries)
I'm working on IIS 6, Windows 2003 server x64
(I know there is warmup mo...
Using jquery.load() to replace the content of a div everything works great, however there is a major performance issue. The page loaded into the div contains some external javascript files and using HttpWatch I have observed the following:
0 0 GET (Cache) text/javascript /js/file1.js
0 0 GET (Cache) text/javascript /js/file2.js...
The following two Haskell programs for computing the n'th term of the Fibonacci sequence have greatly different performance characteristics:
fib1 n =
case n of
0 -> 1
1 -> 1
x -> (fib1 (x-1)) + (fib1 (x-2))
fib2 n = fibArr !! n where
fibArr = 1:1:[a + b | (a, b) <- zip fibArr (tail fibArr)]
They are very close to math...
I know there's no real right or wrong answer. I'd just like to hear from CSS developers how you like to order your properties and what is your reasoning behind your preference.
Thank you very much.
...
Hi! I have quite some trouble with actors which contain long running operations, in my case persistent socket connections. Here is some test code which runs fine if I create less than four Server instances, but if I create more instances, I always end up with only three or sometimes four concurrent socket connections, because the other o...
When I enable trace, e.g.:
How badly this affects application performance?
...
1)Are SQL query execution times O(n) compared to the number of joins, if indexes are not used? If not, what kind of relationship are we likely to expect? And can indexing improve the actual big-O time-complexity, or does it only reduce the entire query time by some constant factor?
Slightly vague question, I'm sure it varies a lot but I...
I like to think I know enought theory, but I have little experience optimizing DB in real world.
I would like to know points of view, thoughts or experiences.
Let's imagine a scenario like:
Table A
Key: c1, c2, c3, c4
Index: c7, c3, c2
Table B
Key: c1, c2, c3, c4
Index: c1, c5
All are non-clustered.
The tables have 40+ fields.
They a...
I'm maintaining an app which adds/removes columns from increasingly large tables -- not often, but regularly (during deployment of new versions, and hence also frequently during development).
Right now, we're using InnoDB. Performance of adding a column isn't great: it has to copy the entire table.
I've read that the Falcon engine doe...
I have some gigantic (several gigabyte) ASCII text files that I need to read in line-by-line, convert certain columns to floating point, and do a few simple operations on these numbers. It's pretty straightforward stuff, except that I'm thinking that there has to be a way to speed it up a whole bunch. The program never uses the equival...
Suppose, I wanted to develop stack overflow website. How do I estimate the amount of commodity hardware required to support this website assuming 1 million requests per day. Are there any case studies that explains the performance improvements possible in this situation?
I know I/O bottleneck is the major bottleneck in most systems. Wha...
Using SQL Server 2005. This is something I've noticed while doing some performance analysis.
I have a large table with about 100 million rows. I'm comparing the performance of different indexes on the table, to see what the most optimal is for my test scenario which is doing about 10,000 inserts on that table, among other things on othe...
A project I'm currently working currently has about 10 ULs, each which will have anywhere from 10-50 elements in them. Its been proposed that each of those elements have a unique ID specified to it that we will use to update content with via Javascript.
This seems like a large number of IDs to add to a page, but each field will have ...
Consider the following shell script:
gzip -dc in.gz | sed -e 's/@/_at_/g' | gzip -c > out.gz
This has three processes working in parallel to decompress a stream, modify it, and re-compress it. Running time I can see my user time is about twice that of my real time, which indicates the program is effectively working in parallel.
I'...