performance

What is the performance cost of having a virtual method in a C++ class?

Having at least one virtual method in a C++ class (or any of its parent classes) means that the class will have a virtual table, and every instance will have a virtual pointer. So the memory cost is quite clear. The most important is the memory cost on the instances (especially if the instances are small, for example if they are just m...

What tool can monitor my SQL Server usage and suggest optimizations?

I have a vague recollection of hearing about a profiling tool that could sit and watch the SQL Server that is serving data to my production website. In particular, I'm looking for a tool that can, based on profiling what is actually taking the most time, do things like make suggestions for new indexes or other sorts of simple optimizati...

Delphi Adding Items to ComboBox Speed

Hi Everyone, I have a fairly complex and large application that hands loads and loads of data. Is there a speedy way to add items to ComboBox that doesn't take so long? On my P3 3.2ghz, the following snippet takes just under a second to add around 32,000 items. (MasterCIList is a StringList with strings typically 20 - 30 bytes long)....

Fastest implementation of a true random number generator in C#

I was reading about Random.Next() that for "cryptographically secure random number suitable for creating a random password" MSDN suggests RNGCryptoServiceProvider Class What the speed penality? There is some fastest way to get true random numbers? EDIT: With Random.Next() I get a new random number. And with... byte[] randomNumber = ne...

Large volume database updates with an ORM

I like ORM tools, but I have often thought that for large updates (thousands of rows), it seems inefficient to load, update and save when something like UPDATE [table] set [column] = [value] WHERE [predicate] would give much better performance. However, assuming one wanted to go down this route for performance reasons, how would you ...

Performance of inner join compared to cross join

The effect of issuing an inner join is the same as stating a cross join with the join condition in the WHERE-clause. I noticed that many people in my company use cross joins, where I would use inner joins. I didn't notice any significant performance gain after changing some of these queries and was wondering if it was just a coincidence ...

Should We Use Long-Name Or Short-Name in JavaScript Coding?

There is a discussion about JavaScript coding in my work group. Some people argues that we should use long-name for better readability; the others believes that short-name should be favored to same bits-on-wire. Generally, it is about coding convention. One side believes that identifier such as "fAutoAdjustWidth" is OK, while others pre...

Entity framework and performance

Hi, I am trying to develop my first web project using the entity framework, while I love the way that you can use linq instead of writing sql, I do have some severe performance issuses. I have a lot of unhandled data in a table which I would like to do a few transformations on and then insert into another table. I run through all objects...

is python slower than java/C#?

is python slower than java/C#? performance-comparison-c-java-python-ruby-jython-jruby-groovy Here is a project that optimizes CPython unladen-swallow ...

Alternatives to the MEMORY storage engine for MySQL

Howdy! I'm currently running some intensive SELECT queries against a MyISAM table. The table is around 100 MiB (800,000 rows) and it never changes. I need to increase the performance of my script, so I was thinking on moving the table from MyISAM to the MEMORY storage engine, so I could load it completely into the memory. Besides the ...

Why Is HTTP/SOAP considered to be "thick"

I've heard some opinions that the SOAP/HTTP web service call stack is "thick" or "heavyweight," but I can't really pinpoint why. Would it be considered thick because of the serialization/deserialization of the SOAP envelope and the message? Is that really a heavy-weight operation? Or is it just considered "thick" compared to a raw/bin...

What is the performance impact of tracing in C# and ASP.NET?

I found this in some production login code I was looking at recently... HttpContext.Current.Trace.Write(query + ": " + username + ", " + password)); ...where query is a short SQL query to grab matching users. Does this have any sort of performance impact? I assume its very small. Also, what is the purpose of this exact type of trac...

Fastest method for checking overflow?

Here's my attempt. Any tips on a better solution?: // for loop to convert 32 to 16 bits uint32_t i; int32_t * samps32 = (int32_t *)&(inIQbuffer[0]); int16_t * samps16 = (int16_t *)&(outIQbuffer[0]); for( i = 0; i < ( num_samples * 2/* because each sample is two int32 s*/ ); i++ ) { overflowCount += ( abs(samps32[i]) & 0xFFFF8000 ) ?...

Key-Value based databases, can someone explain to me how to use them practically?

Hi, There seems to be a big push for key/value based databases, which I believe memcache to be. Is the value usually some sort of collection or xml file that would hold more meaningfull data? If yes, is it generally faster to deserialize data then to do traditinally JOINS and selects on tables that return a row based result set? ...

Would ReadyBoost have an impact on Visual Studio 2008?

Has anyone seen a performance increase in Visual Studio 2008 by using ReadyBoost in Windows Vista? I have 4G of RAM and adding more will do nothing (I'm running Vista 32), so I'm investigating other options to speed up the responsiveness of the development environment and the build process. Upgrading to 64-bit Windows is not possible. ...

Fastest way to calculate the decimal length of an integer? (.NET)

I have some code that does a lot of comparisons of 64-bit integers, however it must take into account the length of the number, as if it was formatted as a string. I can't change the calling code, only the function. The easiest way (besides .ToString().Length) is: (int)Math.Truncate(Math.Log10(x)) + 1; However that performs rather po...

TCP Socket Server Builds Up CLOSE_WAITs Occasionally Over Time Until Inoperable

Hopefully someone can help us as we're reaching as far as investigation can go! We've got a simple asynchronous socket server written in C# that accepts connections from an ASP.NET web application, is sent a message, performs some processing (usually against a DB but other systems too) and then sends a response back to the client. The c...

Compiling Linq to SQL queries from a non-trivial IQueryable

Is there a way to use the CompiledQuery.Compile method to compile the Expression associated with an IQueryable? Currently I have an IQueryable with a very large Expression tree behind it. The IQueryable was built up using several methods which each supply components. For example, two methods may return IQueryables which are then joined i...

How can I find out why my app is slow?

I have a simple Rails app deployed on a 500 MB Slicehost VPN. I'm the only one who uses the app. When I run it on my laptop, it's fast enough. But the deployed version is insanely slow. It take 6 to 10 seconds to load the login screen. I would like to find out why it's so slow. Is it my code? (Don't think so because it's much faster loc...

Logging complexity and concern about MessageFormat performance.

Hi, My application uses log4j for logging and usually I do logging by checking whether a particular level is enabled and then log like the following if(Logger.isApplicationDebugEnabled()){ Logger.logApplicationDebug("something"+values); } Now this if check reduces our branch coverage during jUnit testing. In order to overcome t...