Performance nightmare

Björn Carlsson

22 to 0.3 seconds!
I found a simple solution to a very common problem. While profiling I found that remove in this little method took a lot of the time.
public void MovePropertyFirst(IProperty property)
{
properties.Remove(property);
properties.Insert(0, property);
}
The reason [...]

Tags: ,

Learn to Stop Worrying and Love the Singleton

Fredrik Olsson

Enterprise applications and mobile applications have quite different requirements. Starting an enterprise application is just something you do once before it continue running for months or years. On the other side of the spectrum most mobile applications seldom runs for more than minutes, run by a bored users standing in line or riding the bus. [...]

Tags: , , , , ,

Queued Background Tasks for Cocoa

Fredrik Olsson

The megahertz race is over, and instead we get more execution cores. This means that we as developers must make our applications parallel, in order to take advantage of the new performance. The easiest way to be parallel is to execute tasks in new threads, something that is useful also for lengthy but not resource [...]

Tags: , , , , , , , , , ,

Regular Expressions and Cocoa

Fredrik Olsson

Regular expressions is a powerful tool for solving many problems related to text. It can be misused as any good tool, but there are moments when they are the best solution for a given problem. At those moments the lack of regular expressions for Cocoa on Mac OS X and Cocoa Touch on iPhone OS [...]

Tags: , , , , , , , , ,

Adding Sorted Inserts to Cocoa Arrays

Fredrik Olsson

NSArray and NSMutableArray have methods for sorting arrays, NSArray returns new sorted arrays and NSMutableArray can be sorted in place. The sort methods comes in three flavours; using a function, using a selector, or using an array of NSSortDescriptor objects.
NSArray admits to sorts being a slow operation, and adds a method pair for comultive sorts [...]

Tags: , , , , , ,

Squid, the caching proxy

Ulrik Sandberg

I just checked out the old Squid again, the worlds most famous caching proxy. If you direct all your web access through the Squid proxy server, it will cache stuff after the first access. This would simplify for example for labs where fifty people simultaneously begin retrieving stuff from a Maven repo somewhere or downloading [...]

Tags: , , , , ,