performance

PHP foreach function performance

Does anyone know if doing this foreach ($user->getFriends() as $friend) { // Do something. } Causes PHP to call the function getFriends() on the user object multiple times and thus would this be more efficient? $friends = $user->getFriends(); foreach ($friends as $f) { // Do something. } ...

Logging partial times in production

Is it possible to just log partial times without turning on all logging with? config.log_level = :debug I just want to see partial times as all the others seem under control and don't want to slow down the application to get this logging. ...

LINQ performance FAQ

I am trying to get to grips with LINQ. The thing that bothers me most is that even as I understand the syntax better, I don't want to unwittingly sacrifice performance for expressiveness. Are they any good centralized repositories of information or books for 'Effective LINQ' ? Failing that, what is your own personal favourite high-p...

Memory Leak in a Java based application

There is a memory leak happens in an application when a short lived object holds a long lived object, My question is how can we identify 1) which object lives longer and shorter, any tool which measures life of an object? 2nd Question I am constantly getting the Out of Memory Space Error and I tried increasing the Heap memory to 2 GB...

Is LINQ banned in your company?

I work for a large company who develop enterprise applications which are performance oriented. Virtually every line of code is closely scrutinised and optimized as much as possible to ensure the best performance. Company policy dictates that LINQ is strictly banned. This is because it is believed that LINQ has a negative performance im...

make Eclipse slimmer

Hi all. I am trying to run Eclipse on my netbook to be able to develop for Android. As you may guess, Eclipse is quite slow and it is not easy to develop effectively. I am using Linux Ubuntu and I have still 0.5GB of free RAM...the CPU is the bottleneck. Have you got any tip to slim Eclipse down and make it run faster? Thanks, Dan ...

Is there something wrong with this python code, why does it run so slow compared to ruby?

I was interested in comparing ruby speed vs python so I took the simplest recursive calculation, namely print the fibonacci sequance. This is the python code #!/usr/bin/python2.7 def fib(n): if n == 0: return 0 elif n == 1: return 1 else: return fib(n-1)+fib(n-2) i = 0 while...

Speed up selectors and method

Before I dive in to the jQuery/Sizzle source I thought i'd ask here about ways to speed the below method up. This is a standard "Check All" checkbox scenario. A header cell (<thead><tr><th>) has a checkbox that when checked checks all other checkboxes in it's table's tbody that are in the same column. This works: // We want to check/u...

compare jquery selectors performance

Looking at improving the performance of my jquery selectors. so any tips or articles as the best per formant jquery selectors? For example selecting the a div's id. Anywhere online I can provide html and compare the different selectors I can use to select the required element. ...

No direct access to data row in clustered table - why?

[11] tells: "In a nonclustered index, the leaf level does not contain all the data. In addition to the key values, each index row in the leaf level (the lowest level of the tree) contains a bookmark that tells SQL Server where to find the data row corresponding to the key in the index. A bookmark can take one of two forms. If the...

Windows Mobile Application structure recommendations

I need to create Solution Architechure for Windows Mobile and have following queries: My application is like a service that will start in phone startup and that should run in background and have no UI (this is not a problem). I am using third party dlls (with source code) in my project. Does windows mobile have any problem of loading dl...

Memory space required for a Static String constant in Java?

How much memory will JVM Allocate to 1) Static String 2) Static Integer I am exploring this issue as I am getting Heap Memory Out of Memory Exception, I have in my application 8 constants file and each file has almost near to 300 Static Constants. Is that a good practice to declare all the constants as a Static or any other practice c...

How do you measure cache performance?

Hi, I was curious as to how is cache performance measured. Can you do it programmatically or do you need specialized tools for this purpose? Does the programming language being used matter? Thanks, Abhinav. ...

What do I miss in understanding the clustered index?

In absence of any index the table rows are accessed through IAM ((Index Allocation Map). Can I directly access a row programmatically using IAM? Does absence of index mean that the only way to read specific row is full table scan reading all table? Why IAM cannot be engaged for more specific direct access? "If the table is a hea...

Tomcat native library benefits

Can anyone advise on the main benefits of installing the Tomcat native library? I am running a standard installation of Tomcat to serve a moderately complex intranet based web app using Ext Js on the front end so lots of javascript and AJAX over the network and VPN from various locations. Is it even worth installing this library for th...

Order By Columns

Does adding more columns to ORDER BY have a performance penalty? ORDER BY STYLE vs. ORDER BY STYLE, SIZE, COLOR ...

Performance of dynamic_cast?

Before reading the question: This question is not about how useful it is to use dynamic_cast. Its just about its performance. I've recently developed a design where dynamic_cast is used a lot. When discussing it with co-workers almost everyone says that dynamic_cast shouldn't be used because of its bad performance (these are co-workers ...

Very slow request on temporary table

On my MS SQL Server 2008, I've created a temporary table like this : create table #test ( A varchar(50), B int, ) insert into #test select 'a',45 insert into #test select 'b',587 insert into #test select 'a',4 insert into #test select 'b',58 Now the following request take forever select A,SUM(B) from #test group by A -- takes 4 seco...

Can you use ANTS Performance Profiler to profile an application hitting SQL Server Express editions?

I want to know if it's possible to profile my web application when it's hitting a database on a SQL Server Express server with ANTS profiler. Out of the box, I'm not able to. It's complaining about: No event provider could be located for the SQL server instance 'SQLEXPRESS' Has anyone been able to get around this, or do I have ...

Strategy to fetch a subset of a collection

I have a scenario where my application has access to a session for limited time windows, during which it must fetch data from the database into memory, and then only use the in-memory data to serve requests. The data model is a simple one-to-many association such as: <class name="com.foo.Road" table="road"> <id name="oid" column="o...