performance

Is it faster to check if length = 0 than to compare it to an empty string?

I've heard that in some programming languages it is faster to check if the length of a string is 0, than to check if the content is "". Is this also true for T-SQL? Sample: SELECT user_id FROM users WHERE LEN(user_email) = 0 vs. SELECT user_id FROM users WHERE user_email = '' ...

Surprising performance differences: List.Constains,SortedList.ContainsKey,DataRowCollection.Contains,DataTable.Select, DataTable.FindBy

Originally i wanted to ask for the fastest way to query a Datatable for a special row. I have tested 5 different methods for their performance with a surprising(for me) result. Background: I have created a View in a MS Sql-Server 2005 Database. This view has current a total count of 6318 rows. Because i must check very often if a given...

Scheme: Data serializing, efficient [and functional]

I'm serializing data which may be an integer, an object (list) with other nested objects, and trying to make a choice as to what approach to be using. Of two, the first one is to create bytevectors recursively and copy them in the calling functions to a larger single bytevector; the second one is to use some kind of the stream I could wr...

Minimize the number of cross-core context switches

I was experimenting a lot with application profiling lately (using Visual Studio Performance Wizard). While working with Concurrency indicators, I've noticed the fact that when the application runs with multiple threads (both background and foreground) the cross-core context switch rate is quite high. Knowing that generally a large numb...

Using NHibernate to Index Large Amounts of Data in Lucene.Net

We are using Nhibernate as our data access layer. We have a table of 1.7 million records which we need to index one by one through Lucene for our search. As we run the console app we wrote to build our index, it starts off fast, but as it goes through the items, it progressively gets slower and slower. Our First iteration was to just ...

Linux Multi-Threaded Performance Enhancements for File open()

Hello all, I’m working on tuning performance on a high-performance, high-capacity data engine which ultimately services an end-user web experience. Specifically, the piece delegated to me revolves around characterizing multi-threaded file IO and memory mapping of the data to local cache. In writing test applications to isolate the tim...

PHP Object Oriented Way

So I am thinking of doing my PHP in OO way. Can someone tell me the advantage/ disadvantage of this? I think one advantage will be that my codes will be cleaner and easier to maintain. What about performance? How does doing PHP in OO way compare to just writing codes in non-OO way. My idea of an OO style is, for example, when handling e...

iPhone performance testing: capture step execution time

I used to use Shark for this, but with the upgrade to iOS 4 Shark is flubbed, with no plans by Apple for fixing this. So now I'm trying to massage time profiler into giving me the data I need in a simple, easy to understand format. I've got a number of steps in a typical workflow for my application, and I want to determine the time it i...

Devel Show Queries

I may be missing something obvious here, but in the devel module settings I have checked "Collect query info" and "Display query log", and saved. Where does this information show up? I don't see anything different when I load pages. Is there a variable that I need to inject somewhere in my templates that I missed? I would like to view wh...

Member versus global array access performance

Consider the following situation: class MyFoo { public: MyFoo(); ~MyFoo(); void doSomething(void); private: unsigned short things[10]; }; class MyBar { public: MyBar(unsigned short* globalThings); ~MyBar(); void doSomething(void); private: unsigned short* things; }; MyFoo::MyFoo() { int i; for (i=0;i<10;i++) this...

jsp:include , performance, modularization, alternatives and best practices, Part 96

Hi all, This is a follow-up to the 'overhead of jsp include' question below: http://stackoverflow.com/questions/1479218/jsp-performance-using-jspinclude In our application, developers have 'modularized' jsp fragments by heavy use of "jsp:includes" for "common" jsp code repeated throughout the application. Pros The pro's are as follo...

Performance of message-passing in the Actor model

I've seen benchmarks of Actor model implementations done in terms of their actors. For example, Akka actors are very lightweight (600 bytes per actor) and millions of them can be created. However, I've never seen a benchmark done in terms of message-passing throughput. For example, given some number of actors, how many messages can pass...

In mysql is "WHERE a = 2 AND b = 'Wiliam'" the same as "WHERE b = 'Wiliam' AND a = 2"?

In mysql, does the order of the WHERE clauses affect the time that it takes the server to process the query? I know that the queries are compiled and optimized, but I don't know if that optimization changes the order of the WHERE clauses so in a hypothetic case it will take less time to process a query that first selects the results wit...

asp.net application performance and stress testing ? Please guide

Hello, thanks for your attention and time. I want to test asp.net application for stress, load and performance. Please guide me what free tools should be used for this ? Is there any tool which particularly can be used to analyse individual components, functions and scripts and resources they use ? Thanks in anticipation for your help...

Troubleshooting SQL Server Memory Issues

Currently an active database continues to use more memory until it reaches about 5.8GB and then starts throwing frequent connection timeout errors. I understand that SQL Server is designed to use as much memory as possible, but It shouldn't be throwing those errors. In particular, something seems to run which causes the memory to grow by...

Flipping sign on packed SSE floats.

I'm looking for the most efficient method of flipping the sign on all four floats packed in an SSE register. I have not found an intrinsic for doing this in the Intel Architecture software dev manual. Below are the things I've already tried. For each case I looped over the code 10 billion times and got the wall-time indicated. I'm ...

SQL : The influence of research speed with empty clolumns?

Hi, I'd like to know if some empty columns (with the field 'null' for example) can decrease the speed to make a query "SELECT" on a indexed column or a normal column. Thanks, Ba ...

How can I optimize a calculation-intensive C++ program with a known bottleneck?

I am developing some scientific software for my university. It is being written in C++ on Windows (VS2008). The algorithm must calculate some values for a large number of matrix pairs, that is, at the core resides a loop iterating over the matrices, collecting some data, e.g.: sumA = sumAsq = sumB = sumBsq = diffsum = diffsumsq = return...

How much time would be good to set in expire header for a website?

"Web pages are becoming increasingly complex with more scripts, style sheets, images, and Flash on them. A first-time visit to a page may require several HTTP requests to load all the components. By using Expires headers these components become cacheable, which avoids unnecessary HTTP requests on subsequent page views....

Drupal's Aggresive or External-mode Caching and the i18n Module

If you're not a native English speaker doing Drupal, then the i18n module is probably the only way. This is why it seems very strange to me that the performance admin page says that i18n might not work with aggressive caching or (in the case of PressFlow) external-mode caching. I find it hard to believe that multilingual drupal sites sc...