performance

How can I overcome the overhead of creating a List<T> from an IEnumerable<T>?

I am using some of the LINQ select stuff to create some collections, which return IEnumerable<T>. In my case I need a List<T>, so I am passing the result to List<T>'s constructor to create one. I am wondering about the overhead of doing this. The items in my collections are usually in the millions, so I need to consider this. I assume...

When does a database table get large enough that an index is beneficial?

Hypothetically, in a SQL Server database, if I have a table with two int fields (say a many-to-many relation) that participates in joins between two other tables, at what approximate size does the table become large enough where the performance benefit of indexes on the two int fields overcomes the overhead imposed by said indexes? Are ...

Choosing the right data structure for this problem: circular linked list, list, array or something else

The requirement I have is for every type T, I have a number of elements (between 1-30+) and at first I need random item, then I need the next, and when I reach the last item, it should return the first one and so on. So say T is Icon, and the collection is Images (instance). I want to have: // program start: Icon icon = RandomIcon();...

how do you show page load time in php?

What is the code to show how long it took for PHP to process a page? Also, how many sql queries were performed to generate that page? ...

Is immutability useful on non parallel applications?

I like the immutability concept but sometimes I wonder, when an application isn't meant to be parallel, should one avoid making things immutable? When an application isn't multi-threaded, you aren't plagued by shared state problems, right? Or is immutability a concept like OOP that you either use all the way or not? Excluding the cases...

Strategies For AutoCompletion Web Services in .Net. Non UI focused

I'm getting a little tired of all the UI demos of auto completion in ASP.Net. I believe the UI portion of autocompletion has been solved multiple times over again. My question is how do you best handle the queries hitting your webservices? I'm currently implementing an autocompletion service for a musician database. The database is fai...

How to keep Hibernate mapping use under control as requirements grow

I've worked on a number of Java web apps where persistence is via Hibernate, and we start off with some central class (e.g. an insurance application) without any time being spent considering how to break things up into manageable chunks. Over time as features are added we add more mappings (rates, clients, addresses, etc.) and then amoun...

Timing Objective-C code

Hello! I would like to add some automated performance test to my Objective-C application. (This is a game, so that I would like to see the current performance of key parts of the engine by simply running a set of tests.) To do this I want to write some timing support routine, something like this: - (void) benchmarkSelector: (SEL) msg o...

Is excessive use of lucene good?

In my project, entire searching and listing of content is depend on Lucene. I am not facing any performance issues. Still, the project is in development phase and long way to go in production. I have to find out the performance issues before the project completed in large structure. Whether the excessive use of lucene is feasible or no...

How to speed up "select count(*)" with "group by" and "where"?

How to speed up select count(*) with group by? It's too slow and is used very frequently. I have a big trouble using select count(*) and group by with a table having more than 3,000,000 rows. select object_title,count(*) as hot_num from relations where relation_title='XXXX' group by object_title relation_title, object_title i...

Performance Tuning, WebApplication

Whats are the possible approaches to performance tune a J2ee web-app? Actually the pages take time to load..i have am able to cache the DB results ...

Should one steer clear of adding yet another field to a larger MySQL table?

I have a MySQL-InnoDB table with 350,000+ rows, containing a couple of things like id, otherId, shortTitle and so on. Now I'm in need of a Bool/ Bit field for perhaps a couple of hundreds or thousands of those rows. Should I just add that bool field into the table, or should I best create a new table referencing the IDs of the old table ...

SQL Server Profiler discrepancy

Hello, I am struggling with a strange problem using Sql Profiler. While running some performance testing scripts, I run profiler to find bottlenecks. One particular statement seems to be taking a lot of time - with CPU 1407, Reads 75668 and Duration of 175. However when I run the same statement in Management Studio, SQL Profiler return...

How do you do page performance tests?

I know everyone who reads the question will think "Firebug!" right away. Maybe some will think "YSlow!" and "Google Page Speed!" While I really like these tools, I'm more concerned with how the quickly the page will render in IE 6/7/8. All of the above tools require Firefox. That's all fine and you can definitely test the underlying spe...

Will using multiple threads with a RandomAccessFile help performance?

I am working on a (database-ish) project, where data is stored in a flat file. For reading/writing I'm using the RandomAccessFile class. Will I gain anything from multithreading, and giving each thread an instance each of RandomAccessFile, or will one thread/instance be just as fast? Is there any difference in reading/writing, as you can...

CVS Performance

Hi guys! I have huge projects on a CVS repository, and I'm looking for ways to improve its performance. Would CVS compression help it? And what about encryption, does it degrade the speed? Thanks! ...

Most efficient way to monitor a queue

What is the most efficient way to monitor a queue. The follwoing piece of code is the biggest hog of resources : /// <summary> /// Starts the service. /// </summary> private void StartService() { while (true) { //the check on count is not thread safe while (_MessageQueue.Count > 0) { Common.I...

SQL Server 2008 express performance in production environment?

Hi there, I am about to move servers and i was talking to somebody and they suggested using sql server express 2008 installed on the servers. I have full access to the server. Does this express engine work at the same speed (performance) as a true sql server 2008? I know about the limitations i..e max 4 GB per DB ... and max 1 GB of r...

Performance of Interlocked.Increment

Is Interlocked.Increment(ref x) faster or slower than x++ for ints and longs on various platforms? ...

Java performance Inconsistent

I have an interpreter written in Java. I am trying to test the performance results of various optimisations in the interpreter. To do this I parse the code and then repeatedly run the interpreter over the code, this continues until I get 5 runs which differ by a very small margin (0.1s in the times below), the mean is taken and printed. ...