performance

LINQ to Objects Optimization Techniques?

What LINQ to Objects optimization techniques do you use or have you seen in the wild? While waiting for "yield foreach" and other language/compiler optimizations to arrive in C# in 201x, I'm interesting in doing everything possible to make using LINQ everywhere less of a performance pain. One pattern I've seen so far is creating custom...

Full HTTP URL vs document root URL performances

I noticed a performance degradation when in my webpages I use the full HTTP URL to load an image. Let's say my website is on mydomain.com. Let's say images are all in mydomain.com/imgs directory. It seems it's slower when I place images in the webpage using the full URL format: <img src="http://mydomain.com/imgs/someimg.jpg"&gt; ra...

C/C++ versus Java/C# in high-performance applications

hello My Question is regarding performance of Java versus compiled code, for example C++/fortran/assembly in high-performance numerical applications. I know this is contentious topic, but I am looking for specific answers/examples. Also community wiki. I have asked similar questions before, but I think I put it broadly and did not get...

When, if ever, is loop unrolling still useful?

I've been trying to optimize some extremely performance-critical code (a quick sort algorithm that's being called millions and millions of times inside a monte carlo simulation) by loop unrolling. Here's the inner loop I'm trying to speed up: // Search for elements to swap. while(myArray[++index1] < pivot) {} while(pivot < myArray[--in...

In what way does denormalization improve database performance?

I heard a lot about denormalization which was made to improve performance of certain application. But I've never tried to do anything related. So, I'm just curious, which places in normalized DB makes performance worse or in other words, what are denormalization principles? How can I use this technique if I need to improve performance?...

Two single-column indexes vs one two-column index in MySQL?

I'm faced with the following and I'm not sure what's best practice. Consider the following table (which will get large): id PK | giver_id FK | recipient_id FK | date I'm using InnoDB and from what I understand, it creates indices automatically for the two foreign key columns. However, I'll also be doing lots of queries where I need to...

Is it possible to use perf4j without log4j?

I'm writing a library and would like to use perf4j mainly to expose JMX performance counters. According to the instructions here http://perf4j.codehaus.org/devguide.html perf4j is meant to be used in conjunction with log4j, however since I'm writing a library I have no control over log4j usage, users of the library may or may not wish to...

Which Data Structure? LinkedList or Any Other in Java?

I have specific requirements for the data structure to be used in my program in Java. It (Data Structure) should be able to hold large amounts of data (not fixed), my main operations would be to add at the end, and delete/read from the beginning (LinkedLists look good soo far). But occasionally, I need to delete from the middle also and ...

How is the PHP array implemented on the C level?

The PHP array is one of the language's core features IMHO. It is sparse, allows multi-typed keys in the same array, and supports set, dictionary, array, stack/queue and iterative functionality. BUT after working with PHP for a while now, I've found that quite a few of the array_* functions are much slower than you'd think at first glanc...

When using of full text indexing in sql server give me better performance? In every where or in some situations?

I write a big application by using of NHibernate ORM. Is using of full text indexing in DB level has advantages for my application performance? does it give me better performance in searches? ...

Bunch of Inserts (transaction) is quicker than each insert separatelly

Bunch of Inserts (transaction) is quicker than each insert separatelly, i think so, maybe not, tell me who check, is there a difference, maybe if many indexes on a table. ...

C++: How to improve performance of custom class that will be copied often?

I am moving to C++ from Java and I am having a lot of trouble understanding the basics of how C++ classes work and best practices for designing them. Specifically I am wondering if I should be using a pointer to my class member in the following case. I have a custom class Foo which which represents the state of a game on a specific turn...

Is my DB connection closed? (Linq to Sql)

Hi, I'm using Linq to SQL and read in a blog post about closing database connections as soon as possible. As an example, they showed a variable being converted to a list (using .ToList()) instead of actually returning the Linq query. I have the below code: public static bool HasPassword(string userId) { ProjDataContext db = new...

Tomcat memory information

hi, i wrote a little test programm which queries the status servlet of a tomcat an fetches the memory information of the jvm (free,total,max). Is there a way to get more information ? Like CPU, memory of the process, system memory and so on. I know that some of these things may possible to get somehow because there are tools (e.g. probe...

Cache bandwidth per tick for modern CPUs

Hello What is a speed of cache accessing for modern CPUs? How many bytes can be read or written from memory every processor clock tick by Intel P4, Core2, Corei7, AMD? Please, answer with both theoretical (width of ld/sd unit with its throughput in uOPs/tick) and practical numbers (even memcpy speed tests, or STREAM benchmark), if any....

Buffer.BlockCopy vs unsafe byte* pointer copy

which one has better performance when copy a block of byte? ...

sql server 2005 - previously quick executing stored proc run slowly until dropped and recreated

Hi, I've got a stored proc that after a period of weeks will start to run very slowly. It starts its life executing in a few seconds and ends up taking a couple of minutes to execute. We've found that dropping and recreating the procedure results in it executing in a few seconds again. The procedure itself contains a few inner joins an...

Ado.net performance:What does SNIReadSync do?

We have a query that takes 2 seconds to run in Sql Server Management Studio but it takes 13 seconds to be shown on a client screen. I used dotTrace to profile my source code and noticed there is this SNIReadSync method (part of ADO.net assemblies)that takes a lot of time to do its job(9 seconds).I ran my source over server so I could omi...

How To Simplified Application Structure ?

It is always a good idea to simlified the project relations and also writing code in projects. But as I am not a software analyzer and trying to start analyzing my personal project. I want to know that How To Simplified Project Structure ? ...

Performance of IPX/SPX and TCP/IP

Hi, I understand that IPX and SPX both provide connection services similar to TCP/IP. Here, IPX is similar to IP and SPX is similar to TCP and hence eager to know about this. How does the performance of IPX/SPX exceed that of TCP in LAN ? Why is IPX/SPX not used in LAN alone if its performance is superior to that of TCP in the case of L...