performance

Antivirus on application servers which deal with lots of network traffic. Yes or No?

Interested in people's opinion. You have an application server running 3/4 services that do lots of TCP based communication to/from the server. There is also a fairly heafty amount of MSSQL work going on too. Do you run something like Symantec Anti-Virus with proactive/real time/heuristic/foo protection on the server? Or do you per...

Performance implications with 'clean code'

At my workplace we're planning a major refactor on our core product, a web application with several 'modules'. I quoted that because that's one of our main concerns: modules are not really modules, the whole thing is monolithic. The application is written in PHP with smarty templating and using Pear for accessing a MySQL database. We're ...

Necessity of foreign key in this case(innoDB/mysql)

Hi, i recently migrated my whole DB from myisam to innodb. I am fairly new to all this so i have a question regarding the use of the foreign key. Lets say i have two tables: users, messages. users id (pr_key) name messages id (pr_key) user_id message The id fields are both auto incremented. So now in my queries i join th...

What and how much overheads happen when I use a Reference class?

I saw there is a daemon thread running whenever we create a referenced object using any Reference class like WeakReference, FinalReference, SoftReference, PhantomReference, Referemce And if we have hierarchal thread structure then at each level there is an extra daemon thread initiated. ...

What is MySQL primary (key1, key2)

I am working on existing DB and try to optimize it. I see a table without a single primary key but with two foreign keys work as a primary key. I know it will work. however, is it better to have one single primary key with two foreign keys for better performance or primary (key1, key2) will just work as good as one? For example: CREA...

Predicting performance for an iPhone/iPod Touch App

I don't have an iPhone Developer Program Account yet and will be getting one in the next couple of days. Can instruments be used with the simulator to give a rough estimate on how well my app may perform? Using instruments I checked and fixed all the leaks it was detecting, and it appears that my memory usage maxes out at about 5.77mb. I...

When should I use ConcurrentSkipListMap?

In Java, ConcurrentHashMap is there for better multithreading solution. Then when should I use ConcurrentSkipListMap? Is it a redundancy? Does multithreading aspects between these two are common? ...

Advice on implementing low-level libraries in D (as opposed to C/C++)

I need some advice on selecting the D programming language for a project. The project is a low-level library akin to a database with many associative containers and so forth. Hence efficiency is quite important to me. I need to provide a C API for the library for compatibility with other languages like C++ and Python and I also anticipa...

Which API in Java to use for file reading to have best performance?

In my place where I work, used to have files with more than million rows per file. Even though the server memory are more than 10GB with 8GB for JVM, sometimes the server get hanged for few moments and chokes the other tasks. I profiled the code and found that while file reading memory use rises in Giga bytes frequently(1GB to 3GB) and ...

Database: Best performance way to query geo location data ???

I have a MySQL database. I store homes in the database and perform literally just 1 query against the database, but I need this query to be performed super fast, and that's to return all homes within a square box geo latitude & longitude. SELECT * FROM homes WHERE geolat BETWEEN ??? AND ??? AND geolng BETWEEN ??? AND ??? How is the b...

PHP String concatenation - "$a $b" vs $a . " " . $b - performance

Is there a speed difference between, say: $newstring = "$a and $b went out to see $c"; and $newstring = $a . " and " . $b . " went out to see " . $c; and if so, why ? ...

How can I improve the performance of 'include()s' in PHP?

I have a 1.9MB PHP library that I am including at the beginning of my scripts. It contains all of my database objects, methods, etc necessary for my website. It takes 0.1s to 0.3s to include it each time. I use eAccelerator to cache the bytecode of this file. What else can I do to optimize the performance of this 'include'? ...

Lock Free Deque that supports removing an arbitrary node

This needs to be lock free as it has to run in the interrupt handler of an SMP system. I cannot take locks. I have a contiguous array holding some values. Some of the entries in this array are "free", they are not occupied. I want to make a list of these entries so that I can quickly allocate one. However, I occasionally have to allocat...

MySQL performance issue - lots and lots of ORing

The Facebook API has a call $facebook->api_client->friends_getAppUsers(); and that returns the friend ids of a user who is using the app. Now say I want to select from my db table all the rows that match all those friend ids. The only way I can think of doing it would be SELECT * FROM my_table WHERE uid IN(friend1, friend2, friend3, f...

How to implement ConcurrentHashMap with features similar in LinkedHashMap?

I have used LinkedHashMap with accessOrder true along with allowing a maximum of 500 entries at any time as the LRU cache for data. But due to scalability issues I want to move on to some thread-safe alternative. ConcurrentHashMap seems good in that regard, but lacks the features of accessOrder and removeEldestEntry(Map.Entry e) found in...

Need help with designing a query in ELinq

This is my query: Dim vendorId = 1, categoryId = 1 Dim styles = From style In My.Context.Styles.Include("Vendor") _ Where style.Vendor.VendorId = vendorId _ AndAlso (From si In style.StyleItems _ Where si.Item.Group.Category.CategoryId = _ categoryId).Count > 0 _ ...

Effective 15x10 array computation

Hey guys! Now I have one trouble for develope one iPhone app. I need to compute 150 parts and draw it on canvas. I have code like this: for (int i=x1; i<=x2; i++) { for (int j=y1; j<=y2; j++) { x=[NSNumber numberWithInt:i]; y=[NSNumber numberWithInt:j]; BoxCach...

What is the best way of instantiating many JavaScript objects?

I need to create many instances of a specific class in a single page, and I'm wondering if the way that I define the methods of that class will have an impact on the page's performance. Does it matter whether I define the methods like this: function Foo(h, l) { this.h = h; this.l = l; } Foo.prototype.bar = function(x) { // do st...

SQL Server 2008 spatial index and CPU utilization with MapGuide Open Source 2.1

I have a SQL Server table with hundreds of thousands of geometry type parcels. I have made indexes on them trying different combinations of density and objects per cell settings. So far I'm settiling for LOW, LOW, MEDIUM, MEDIUM and 16 objects per cell and I made a SP that sets the bounding box according to the extents of the entities in...

WPF - Is RenderTargetBitmap better than changing an Image Source?

Im trying to create a PNG sequencer class that will allow me to change an ImageBrush's ImageSource property via an animation. The issue is that I have around 150 PNG files to load, and it really really affects performance when I have a few animations on the screen. I have read a little about RenderTargetBitmap and also WriteableBitmap ...