performance

PHP: how is an array in a foreach loop read?

We have all heard of how in a for loop, we should do this: <?php for ($i = 0, $count = count($array); $i < $c; ++$i) { // Do stuff while traversing array } ?> instead of this: <?php for ($i = 0; $i < count($array); ++$i) { // Do stuff while traversing array } ?> for performance reasons (i.e. initializing $count would've...

Performance concerns of instantiating multiple classses in one Form

I would like to know how will performance go when I instantiate multiple classes in one form. e.g Public Class frmClass Dim obja As New ClassA Dim objb As New ClassB Dim objc As New ClassC 'I'll use those classes' attribute in here ' End Class Thanks for your help! ...

WCF performance issue in Vista

Hi there, I am having performance issues with Vista when trying to connect with wsHttpBindings and NetNamedPipeBindings on Vista. I'm having 4 WCF services where the first one connects to the second and the second one connect to two others. The problem is when I run this setup on my Vista (64 bit) desktop the response times a really w...

How fast is Python?

I'm a Java programmer and if theres one thing I dislike about it, it would be speed. Java seems really slow, but a lot of the Python scriptsprograms I have written so far seem really fast. So I was just wondering if Python is faster then Java, or C# and how that compares to C/C++ (which I figure it'll be slower than)? ...

wpf toolkit datagrid performance

Hi, i am porting my application from windows forms to WPF. I have found that datagrid is available only through the WPF Toolkit. However i have some issues with performance. This could be because something that performed alright in windows forms does not in wpf since it has to be implemented differently. Anyhow, i am doing something lik...

Problem having lots of databases?

We have built a hosted web application, that is developed in a way that each customer is connected to an individual database. This application is a web plattform/publishing system, and has been working very well so far with this design. We also have a main database. Now we are about to make some changes in our pricing model, which would...

How can I test the performance of a C function?

Are there some good ways to know how a function performs in C? I would like to, for example compare my own function to a library function. ...

Improving the quick sort.

If possible, how can I improve the following quick sort(performance wise).Any suggestions? void main() { quick(a,0,n-1); } void quick(int a[],int lower,int upper) { int loc; if(lower<upper) { loc=partition(a,lower,upper); quick(a,lower,loc-1); quick(a,loc+1,upper)...

Mysterious pointer-related multithreading slowdown

Background: So I'm working on a raytracer.. for my construction of the spatial partitioning scheme, I initially had some code like this: if (msize <= 2) { // create a leaf node Model **models = new Model*[msize]; for (uint i=0; i<msize; ++i) models[i] = &mlist[i]; *arrayPtr = Node(models, msize); // class Node contai...

Is it OK for a process to be CPU intensive for a prolonged period of time?

The case: A scheduled task running on Windows. The program's job is to extract some information from text documents. It uses a lot of regular expressions to do this. The program is therefore CPU Bound. The service takes every document it finds in a folder and converts them one after another. Normally, everything is OK, the service fi...

GDI+ performance tricks

Does anyone know of any reliable (and, hopefully, extensive) books/websites that discuss GDI+ performance (beyond the obvious)? For example, I recently came across this excellent experiment. I also recently noticed that Graphics.FillPath() is way, way faster than Graphics.DrawPath(). I'd love to know what other vital bits of information...

Performance difference in alternative switches in Python.

I have read a few articles around alternatives to the switch statement in Python. Mainly using dicts instead of lots of if's and elif's. However none really answer the question: is there one with better performance or efficiency? I have read a few arguments that if's and elifs would have to check each statement and becomes inefficient wi...

Slow ASP.NET app load times - Can I track/trace/time the whole load cycle?

Hey all. The ASP.NET web app project I'm currently working on is getting slower over time to re-load (In IIS or the .NET dev server). Currently it takes: 1:28 minutes to load via an F5 debug 41 seconds to refresh in browser, after a build (not rebuild) The machine's reasonably fast - A Core 2 Quad 2.40ghz, 8 gig o' RAM, running the ...

Speed of data access...

Which do you think would be faster: A) Reading a file 512 bytes in length on a solid state drive in a directory of 1 billion files B) Selecting a 512-byte column by unique indexed key from a database table containing 1 billion records EDIT: Would the OS, database, or file system really make the difference? Is it that close of a race?...

does ordering by lot of columns hit the performance badly?

I just ran into a SQL query with about 5 different columns in the ORDER statement, is it a good practice and how does it play with performance? ...

How does ironpython speed compare to other .net languages?

Hi, I would like to give sources for what I'm saying but I just dont have them, it's something I heard. Once a programming professor told me that some software benchmarking done to .net vs Python in some particular items it gave a relation of 5:8 in favor of .NET . That was his argument in favor of Python not being so much slower than ...

YSlow Best Practices with Django apps, How to implement them?

Hi, I have an django 1.1.1 app, actually in developement, thinking in best practices I ran the YSlow test (Grade E Ruleset applied: YSlow V2 ) it recomends: Grade F on Add Expires headers -There are 37 static components without a far-future expiration date. Grade F on Use a Content Delivery Network (CDN) ...

Help understanding SQL Server 2005 execution plan

One of my stored procedure has long execution time (average around 4 to 7 minutes). Now I trying to tweak it an make it run faster. I am looking at execution plan and two things I see that using most of percentage. First is 68% of "Clustered Index Scan" of one main tables for reporting, This table has primary key of two columns and 200...

Beginner RegEx Replace Performance Question

Hi All, I have this simple regex replace based routine, is there anyway to improve its performance (and maybe also its elegance?) public static string stripshrapnel(string str) { string newstr = str.Trim(); newstr = Regex.Replace(newstr, @"-", ""); newstr = Regex.Replace(newstr, @"'", ""); newstr = Regex...

How to do a lot of database queries with less performance?

Hi guys, I have an auction site, not like ebay (as the most think). Now my problem is follow: On the startpage are a lot of auctions displayed (ASP.NET). All Auction (let's say min. 10, max 50) have a timer. Now I must have a look nearly every second for each auction (filter is not started and not ended) if the timer is reseted (what h...