performance

Cost of Reflection while using factory

Good people of stackoverflow, As always, I am writing a factory in order to dynamically instantiate objects. To schematize, I have four types: class CatDescriptor : PetDescriptor class DogDescriptor : PetDescriptor class Cat : Pet class Dog : Pet I instanciate the two last types from the factory. And here comes the dilemma: Should ...

Java performance tips

I have a program I ported from C to Java. Both apps use quicksort to order some partitioned data (genomic coordinates). The Java version runs fast, but I'd like to get it closer to the C version. I am using the Sun JDK v6u14. Obviously I can't get parity with the C application, but I'd like to learn what I can do to eke out as much pe...

Which approach is better performance-wise? (with regard to the usage of variable parameter markers in prepared statement in JDBC)

My objective is to get the DeptNames of certain employees from the Emp table. But the number of employees is varying. Please tell if the below approach is correct and which of the below approach is better performance wise. Or is there a better way to go about it? PreparedStatement pstmt = conn.prepareStatement("SELECT Dept from Emp WHER...

Is it reasonable to integrate python with c for performance?

Hi, I like to use python for almost everything and always had clear in my mind that if for some reason I was to find a bottleneck in my python code(due to python's limitations), I could always use a C script integrated to my code. But, as I started to read a guide on how to integrate python. In the article the author says: There are se...

Speeding up grails test-app

While developing a Grails 1.0.5 app I'm appaled at how slow the grails test-app command is. Even though the actual tests take just ~10 seconds, the whole execution adds up to real 1m26.953s user 0m53.955s sys 0m1.860s This includes grails bootstrapping, loading plugins, compiling all the code etc. Any hints on how to spee...

storing + evaluating performance data

since we suffer from creeping degradation in our web application we decided to monitor our application performance and measure individual actions. for example we will measure the duration of each request, the duration of individual actions like editing a customer or creating an appointment, searching for a contract. in most cases the d...

How do database perform on dense data?

Suppose you have a dense table with an integer primary key, where you know the table will contain 99% of all values from 0 to 1,000,000. A super-efficient way to implement such a table is an array (or a flat file on disk), assuming a fixed record size. Is there a way to achieve similar efficiency using a database? Clarification - When...

How to do performance and scalability testing without clear requirements?

Any idea how to do performance and scalability testing if no clear performance requirements have been defined? More information about my application. The application has 3 components. One component can only run on Linux, the other two components are Java programs so they can run on Linux/Windows/Mac... The 3 components can be deployed ...

Is there any performance reason to not use UserControls?

Is there performance difference when using say 10 user controls on a page vs a page displaying the same data, but without user controls. ...

How can I Monitor the Performance of Individual Apps on Windows?

My XP machine has become terribly slow and I want to identify the application at fault. It seems to be related to disk access rather than processor hogging. I can look at the task manager to get a good idea but it's not ideal. I was wondering if there was some application that can monitor all aspects of processes effectively. Is Proc...

How do I find out what is hammering my SQL Server?

My SQL Server CPU has been at around 90% for the most part of today. I am not in a position to be able to restart it due to it being in constant use. Is it possible to find out what within SQL is causing such a CPU overload? I have run SQL Profiler but so much is going on it's difficult to tell if anything in particular is causing it....

Any tips for improving Visual Studio 2008 ASP.NET designer performance?

It's been bugging me for a while now, but the ASP.NET designer in VS 2008 can be terribly slow for editing even the simplest of pages. The machines we use are not bleeding edge, but one would think that a 2Ghz Dual Core AMD 3800+ with 3Gb of RAM and a 7200RPM 120Gb hard drive would perform better than it does. To quantify the problem, ...

SQL 2005 performance: column order when mixing varchars with int types

I have a table like this: create table SomeTable ( tableKey int identity(1,1) not null , foreignKey int not null , longDesc nvarchar(max) not null , shortName varchar(100) null ) I need to use shortName in a where clause: select tableKey from SomeTable where foreignKey = @foreign...

distinct or group?which is more efficient in mysql?

Here is my trial: mysql> select a.id from iask a -> join ianswer b on a.id=b.iaskid -> join users c on c.id=a.uid -> where (c.last_check is null or a.created>c.last_check) and c.id=1 -> group by a.id; +----...

Why is my page loading slow

I am working on a asp.net website. There are a lot of javascript plug-ins that site uses including the bookmark button(addthis), Google adsense, Admanager tags, Social Bookmarking buttons and so on. The page loads slow and even though I have been using tools like FireBug, I haven't been able to make out why does my page load so slow. ...

When is sql distinct faster than java programming 'distinct'

If I have a sql query that uses 'distinct' (in oracle), would it be faster than retrieving the non-distinct then getting the unique results via java programming? I heard somewhere that oracle sql distinct is heavy, but is it heavier than manual 'distinction' via java programming? Thanks, Franz ...

Java: What's the reason behind System.out.println() being that slow?

For small logical programs that can be done in a text editor, for tracing I use the classic System.out.println(). I guess you all know how frustrating it is to use that in a block of high number of iterations. Why is it so slow? What's the reason behind it? ...

C# Best way of assigning values to strings in a loop

Hi, I wonder what is the most efficient way of assigning string variables in a loop. So, for example if I have to browse through a list of nodes and assigning the value of the node to a string, would it be better if I define a variable before the loop starts like string myStringVariable = string.Empty foreach(XmlNode node in givenNodes)...

Fast Read/Write of Complex .Net Object Graph

Hi, I have my own data structure written in C# (the structure is quite complex). I need to serialize and deserialize the structure. The size of the serialized file in disk can be pretty large at times (close to a 1 GB) but it can be small also (based on the number of records stored). I have the following requirements: The serializatio...

Background Threading in ASP.NET and Impact on Performance

My current site is set up to leave messages for certain people the first time anyone logs into the app. The number of messages left could be anywhere from 1000 to 10000, with each being a query, and all queries in a transaction statement. Yes, I know this seems like poor design, that is not my question. Currently, when a user logs in,...