performance

Ways to improve sql server query optimizer results

The question is quite simple: What can I do to make sure that the SQL Server query optimizer has all the information it needs to choose the "best" query plan? The background of this question is that recently we've run into more and more cases where SQL Server chooses a bad query plan, i.e., cases, where adding query hints, join hints or...

How does an index work on a SQL User-Defined Type (UDT)?

This has been bugging me for a while and I'm hoping that one of the SQL Server experts can shed some light on it. The question is: When you index a SQL Server column containing a UDT (CLR type), how does SQL Server determine what index operation to perform for a given query? Specifically I am thinking of the hierarchyid (AKA SqlHierar...

parallel c# threading performance issues

This code is for transforming from colored to black and white. I tried to add parallel section to the code just transforming from gray-scale to black-white i tried to assign to each thread a number of cols which has amount of pixels but the performance didnt improve at all. I tried for a 800*600 image by changing the divisor value (...

SQL server concurrent accessing

Hi When sql server is receiving two queries (SELECT * From the_Same_Table), at exactly the same time, and if u have a server with multiple processors, Can sql server retrieve the data at the same time? I am trying to understand what will happen if a cheap select statement that finish within .01 sec, and 1000 users run the same query ex...

What is the performance difference, if any, between if(!foo) and if(foo == false) in Java?

Logically, if(!foo) and if(foo == false) are equivalent. How are they represented in Java? Is there any difference between the two after compilation, either in the bytecode or in performance? I was unable to find an answer in the JLS, and searching brought up a lot of results about = vs. == typos and ==/equals() behavior. (In this ca...

What is the fastest way to remove nodes from a large XML file using .net

I am working working with very large XML files (100s of MBs). The tree is fairly simple <items> <item> <column1>ABC</column1> <column2>DEF</column2> </item> <item> <column1>GHI</column1> <column2>KLM</column2> </item> </items> I need to parse this document, and remove some <item> elements. So far, the best peer...

How to efficiently (performance) remove many items from List in Java?

I have quite large List named items (>= 1,000,000 items) and some condition denoted by <cond> that selects items to be deleted and <cond> is true for many (maybe half) of items on my list. My goal is to efficiently remove items selected by <cond> and retain all other items, source list may be modified, new list may be created - best way...

Slow CGLIB Performance using Callback Filters

I'm noticing terrible speeds when trying to use CGLIB with a callback filter (on tens of thousands of objects) but I'm unable to find any information about optimizing CGLIB. For a search/list interface, the system is loading multiple properties from an optimized query and populating the domain tree with those properties. For all other p...

What happens in C++ when an integer type is cast to a floating point type or vice-versa?

Do the underlying bits just get "reinterpreted" as a floating point value? Or is there a run-time conversion to produce the nearest floating point value? Is endianness a factor on any platforms (i.e., endianness of floats differs from ints)? How do different width types behave (e.g., int to float vs. int to double)? What does the l...

Does making a class NotInheritable in VB.NET offer the same (potential) compiler optimizations as sealed in C#?

I've read that making a class sealed in C# is advisable in high-performance scenarios because it frees the compiler to make certain optimizations (e.g., inlining property getters) that it wouldn't be able to make otherwise. Is the same true for NotInheritable in VB.NET? My guess would be yes, but I'm posting this question in case someone...

Compound index required to speed up join-ed query?

A colleague asked me to explain how indexes (indices?) boost up performance; I tried to do so, but got confused myself. I used the model below for explanation (an error/diagnostics logging database). It consists of three tables: List of business systems, table "System" containing their names List of different types of traces, table "Tr...

Is Java "caching" anonymous classes?

Consider the following code: for(int i = 0;i < 200;i++) { ArrayList<Integer> currentList = new ArrayList<Integer>() {{ add(i); }}; // do something with currentList } How will Java treat the class of currentList? Will it consider it a different class for each of the 200 objects? Will it be a performance hit even after the fir...

Check if property has attribute

Given a property in a class, with attributes - what is the fastest way to determine if it contains a given attribute? For example: [IsNotNullable] [IsPK] [IsIdentity] [SequenceNameAttribute("Id")] public Int32 Id { get { return _Id; } set { _Id = val...

Line Level Profiling for iPhone

I'm looking for a way to find out how much time is spent in each of my program's source line when running on the iPhone.Similar to what Shark can provide on the method/function level. Is this possible with the standard tools? Are there 3rd party tools that can provide this sort of granularity? It wouldn't be necessary for profiling data...

WPF drawing performance with large numbers of elements

I'm trying to create a custom control in WPF to display the game tree for a game of go (see here for what it looks like). I've more-or-less got it working laying out the nodes, but one problem I've found is that it begins gets noticeably slow to render/navigate (it's in a scroll viewer) when the number of nodes gets larger than about 30....

VB.NET 'With' statement performance?

What's the performance consequence using the 'With' keyword in vb.net instead of using reusing the instance name over and over? ...

Pooling of custom WCF channel

We have developed a custom WCF channel which communicates via IBM Websphere MQ. We have created a channel factory: public class MqChannelFactory : ChannelFactoryBase<IRequestChannel> Which returns instances of our channel: public class MqRequestChannel : ChannelBase, IRequestChannel Connecting to the IBM MQ queue manager is an ex...

How to improve time performance for retrieving huge data from the database ?

-(void)viewWillAppear:(BOOL)animated { AppDelegate *appDelegate = (AppDelegate *) [ [UIApplication sharedApplication] delegate]; List = [appDelegate getList]; } Here getList is a method that gets the 29000 number of list from the sqlite3 database.I am getting the list but it takes very huge time to respond in the device. Is ...

Performance/profiling measurement in C

I'm doing some prototyping work in C, and I want to compare how long a program takes to complete with various small modifications. I've been using clock; from K&R: clock returns the processor time used by the program since the beginning of execution, or -1 if unavailable. This seems sensible to me, and has been giving results whic...

What optimizations do modern JavaScript engines perform?

By now, most mainstream browsers have started integrating optimizing JIT compilers to their JavaScript interpreters/virtual machines. That's good for everyone. Now, I'd be hard-pressed to know exactly which optimizations they do perform and how to best take advantage of them. Could anyone point me to references on optimizations in each o...