performance

C#: Are struct members more performant?

On a blog entry, Luca Bolognese ponders this idea about structs vs. classes as member fields: The reason to use a struct is to not allocate an additional object on the stack. This allows this solution to be as 'performant' as simply having coded the fields on the class itself. Or at least I think so ... How accurate is th...

Stored Procedure(s) slow on initial execution

Group, I am still learning SQL, and I am running into a new problem. I have a couple stored procedures that are slow on their initial execution/connection. For example, I have a stored procedure (sp) that I use in an application to look up prices for a product. The first time I run the sp in the morning it may take 20-40 seconds to ex...

Java ResourceBundle Performance

I am using a ResourceBundle and Locale to lookup property values. Quite simply, the code looks like this: public static String getPropertyValue(Locale locale, String resourceName, String key) { ResourceBundle resource = ResourceBundle.getBundle(resourceName, locale); return resource.getString(key); } My question is about p...

SQL Server 2008 extremely slow using FTS on joined tables

I have two tables Product (id int, brandid int,Name nvarchar(1000)) 2+ million rows Brand (id int,name nvarchar(1000)) 20k rows FullText index is enabled on both table's name field. If I do a search such as SELECT count(*) FROM Product p join Brand b on p.BrandID = b.ID WHERE contains(b.name,'calvin') Runs super fast...

What is the overhead of a method call in a good Java VM?

Can someone come up with a disassembled machine code assembler listing? I mean there must be some overhead compared to the normal function call in C. The VM needs to track calls to find hotspots and when it uses compiled code it needs to provid ways to change the compiled method on fly if a new loaded class requires a recompilation. I...

Advantages / Disadvantages of pconnect option in CodeIgniter

One of the parameters in the CodeIgniter database config is the following ['pconnect'] TRUE/FALSE - Whether to use a persistent connection What do you recommend I set this to? Is there a significant performance hit if I set it to FALSE? What potential problems might arise from setting it to TRUE? ...

how to efficiently track the use of space on a map, both objects and free areas.

OK I start with a blank map, which is 512x512 = 262144 pixels/locations. I need a way to efficiently draw some objects on it, and then be able to find the areas of free space, so that later more different objects can be added to these free areas. I cant figure out the best way to store this data, or algorithms to find the free areas. I...

How to reduce the total memory hogging by compacting my Objects in Java?

I have a table with around 20 columns with mostly consisting of varchars and decimals. This table has almost 1.5M rows. But few things are common in them like column1 consists of only 100 distinct strings , column2 has almost 1000 and column3 has almost 500. Right now, I am storing all these column values in a map with Key as first 5 c...

Browser support for <script async="true" />?

Today Google announced the support for asynchronous Google Analytics tracking. The asynchronous tracking is achieved using the async directive for the <script> tag. Which browsers support the async directive (<script async="true" />) and since which version? ...

What WCF binding is most performant?

I have to get the maximum throughput performance in my WCF service. In one of my tests the service below got only 50k data items per minute using NetTcpBinding. Would a disconnected binding like NetMsmqBinding improve this performance? Service and client uses WCF and run in the same machine. [ServiceBehavior(InstanceContextMode = Insta...

Do potential exceptions carry an overhead?

Will a piece of code that potentially throws an exception have a degraded performance compared a similar code that doesn't, when the exception isn't thrown? ...

WCF Service call to multiple rows. How to architecture it?

Hi, Let's say I have a scenario where I have a Service that is responsible for retrieving the price of a single product given the ID and another Service that gives me the current stock position of it. It's okay when I'm looking only at one product, but what about a list page where I have 60 products? What should I do in this case? Call...

Caching complex jquery selector based on parent & type

I'm trying to speed up jQuery performance. I found some questions/answers on this site to help but I'm trying to take it a step further... Here's an example of the HTML, quite simplified <div id="Container"> <div> <div> <input type="text" id="something"> </div> <input type="text" id="other"> ...

As2 Benchmarking

I've been looking for a took or a method of benchmarking as2 code specifically individual functions. I've looked at Grant Skinners Performance Test which is for as3 so it does me no good. Does anyone know of an as2 version or a good way to time functions? Thanks in advance! ...

Best way for fast processing

Hello all, As a PHP programmer faced a lot with (deepgoing) statements I'm curious how you handle this. Are you using switch, if-elseif-else or if-else structures? I personally prefer using the switch selector when dealing with more than 2 cases. Is this also the best way from a performance perspective? And how about nested statements?...

Given disk is slow and multiple cores does on the fly decompression make sense for performance?

It used to be that disk compression was used to increase storage space at the expense of efficiency but we were all on single processor systems back then. These days there are extra cores around to potentially do the decompression work in parallel with processing the data. For I/O bound applications (particularly read heavy sequentia...

jQuery: append individually or at once + selectors?

I'm building a jQuery UI widget and when I initialize I create a several divs, anchors, inputs. I've read that it's faster to build up an entire HTML string and then append it to the DOM than to append each individual DOM element. However, I need access to those elements later, so I'm also inclined to build them individually and then a...

How badly does jQuery performance degrade when using a lot of selectors, or does it?

I want to apply a click() event to all of the links on a page when the href of that link points to a file with a specific extension. The list of applicable extensions is hovering around 30 and may grow a bit in the future (but will never be more than 100). My first inclination is to structure the event binding like so: $("a[href$=avi],...

Python Performance on Windows

Is Python generally slower on Windows vs. a *nix machine? Python seems to blaze on my Mac OS X machine whereas it seems to run slower on my Window's Vista machine. The machines are similar in processing power and the vista machine has 1GBs more memory. I particularly notice this in Mercurial but I figure this may simply be how Mercuri...

Cost of using std::map with std::string keys vs int keys?

I know that the individual map queries take a maximum of log(N) time. However I was wondering, I have seen a lot of examples that use strings as map keys. What is the performance cost of associating a std::string as a key to a map instead of an int for example ? std::map<std::string, aClass*> someMap; vs std::map<int, aClass*> someMap; ...