performance

How to write Performance Test for .Net application?

How to write Performance Test for .Net application? Does nUnit or any other Testing framework provides framework for this? Edit: I have to measure performance of WCF Service. ...

SQL Profiler: Read/Write units

i'm running a select query in Query Analyzer. While running SQL Profiler i see that the query took 2,027 reads: EventClass: SQL:BatchCompleted TextData: SELECT Transactions.... CPU: 422 Reads: 2027 Writes: 0 Duration: 466 i ran the query with the SET STATISTICS IO ON option, and i get nowhere clos...

Does Flex/Actionsctipt/Flash implements a mechanism for reusing Sprites?

I'm creating a game and I create sprites(enemies). I keep creating and destroying sprites. Flash/Flex has a garbage collector which handles the destruction of unused resources. Should I create an object pool to reuse them, or should I leave flash/flex to handle the creation/destruction of objects? Which option is better from the perform...

What is so bad about using SQL INNER JOIN

Every time a database diagram gets looked out, one area people are critical of is inner joins. They look at them hard and has questions to see if an inner join really needs to be there. Simple Library Example: A many-to-many relationship is normally defined in SQL with three tables: Book, Category, BookCategory. In this situation, Ca...

What are the suggested alternatives for Class<T>.isAssignableFrom(Class<?> cls)?

Currently I am doing the profiling to a piece of code. During the profiling, I discovered that this very method call, Class<T>.isAssignableFrom(Class<?> cls) takes up to quite amount of the entire time. Because this is a method from reflection, it takes a lot of time compared to normal keywords or method calls. I am wondering if the...

Threading cost - minimum execution time when threads would add speed

I am working on a C# application that works with an array. It walks through it (meaning that at one time only a narrow part of the array is used). I am considering adding threads in it to make it perform faster (it runs on a dualcore computer). The problem is that I do not know if it would actually help, because threads cost something an...

What is optimal hardware configuration for heavy load LAMP application

I need to run Linux-Apache-PHP-MySQL application (Moodle e-learning platform) for a large number of concurrent users - I am aiming 5000 users. By concurrent I mean that 5000 people should be able to work with the application at the same time. "Work" means not only do database reads but writes as well. The application is not very typical...

When is calculating or variable-reading faster?

hi, to be honest, I don't really know what the "small green men" in my cpu and compiler do, so I sometimes would like to know :). Currently I would like to know what's faster, so that I can design my code in a more efficient way. So for example I want to calclate something at different points in my sourcecode, when will it be faster to...

inserting std::strings in to a std::map

I have a program that reads data from a file line-by-line. I would like to copy some substring of that line in to a map as below: std::map< DWORD, std::string > my_map; DWORD index; // populated with some data char buffer[ 1024 ]; // populated with some data char* element_begin; // points to some location in buffer char* element...

Is is faster to filter and get data or filter then get data ?

Hi I have this kind of request : SELECT myTable.ID, myTable.Adress, -- 20 more columns of all kind of type FROM myTable WHERE EXISTS(SELECT * FROM myLink WHERE myLink.FID = myTable.ID and myLink.FID2 = 666) myLink has a lot of rows. Do you think it's faster to do like this : INSERT INTO @result(ID) SELECT myLink.FID FROM...

Really slow obtaining font metrics.

So the problem I have is that I start my application by displaying a simple menu. To size and align the text correctly I need to obtain font metrics and I cannot find a way to do it quickly. I tested my program and it looks like whatever method I use to obtain font metrics the first call takes over 500 milliseconds!? Because of it the ti...

Have parameters in Dao methods to get entities the most efficient way for read-only access

Allot of my use of hibernate, at least for that data that is presented on many parts of the web application, is for read-only purposes. I want to add some parameters to my Dao methods so I can modify the way hibernate pulls the data and how it handles transactions etc. By 'pulls the data' I altering the locking and not having session w...

require_once at the beginning or when really needed?

Where should I put require_once statements, and why? Always on the beginning of a file, before the class, In the actual method when the file is really needed It depends ? Most frameworks put includes at the beginning and do not care if the file is really needed. Using autoloader is the other case here. Edit: Surely, we all agree...

News Portals and database heaviness

What is database design solutions for news portals with high trrafic? Could file system be a good solution? mysql > File system Thanks in advance ...

Postgres not using enough CPU during index build!

I have a Postgres instance building a GIN index. It's looking at about 200,000 rows and it's so far taken about 9 hours. Who knows how long it will take eventually. The problem is that it's using about 2% of CPU when I'd like it to use more like 90%. Is there any way to force it to speed up? ...

Where should the partitioning column go in the primary key on SQL Server?

Using SQL Server 2005 and 2008. I've got a potentially very large table (potentially hundreds of millions of rows) consisting of the following columns: CREATE TABLE ( date SMALLDATETIME, id BIGINT, value FLOAT ) which is being partitioned on column date in daily partitions. The question then is should the primary key be ...

Postgresql performance question about inserting or updating many row containing binary data

Hello, I have a table A where I put many image resources with a daily frequence. Every record of table A references another table B in which there are only fixed records. My question is the following: better to clean all records in A and then inserting new images or updating only the binary column of all records. What your advice? ...

Books and resources for Java Performance tuning - when working with databases, huge lists

Hi All, I am relatively new to working on huge applications in Java. I am working on a Java web service which is pretty heavily used by various clients. The service basically queries the database (hibernate) and then works with a lot of Lists (there are adapters to convert list returned from DB to the interface which the service publish...

If-else-if versus map

Hi, Suppose I have such an if/else-if chain: if( x.GetId() == 1 ) { } else if( x.GetId() == 2 ) { } // ... 50 more else if statements What I wonder is, if I keep a map, will it be any better in terms of performance? (assuming keys are integers) ...

ItemsControl.ItemsSource MVVM performance

I have an (non-virtualized) ItemsControl that binds its ItemsSource to a ObeservableCollection of ViewModel instances. Now once the large amount Model instances is loaded all the ViewModel complemnents needs to be added to that ObservableCollection. How can I add a large amount of ViewModels without making the UI Thread hang? I suppose ...