discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comments on the website from people on twitter...


From: David Chisnall
Subject: Re: Comments on the website from people on twitter...
Date: Sun, 11 Aug 2013 10:44:14 +0100

On 11 Aug 2013, at 09:54, Matt Rice <ratmice@gmail.com> wrote:

> Likewise, a few ported apps have run into the case that NSMutableArray
> usage optimized for OS  X (linked list up to a certain size since
> their implementation varies on array size) exhibits the pathological
> behaviour under GNUstep (c array), and vice versa.

Several of our collections could do with some optimisation.  For example:

- Taking the libstdc++ <tr1/unordered_map> and making NSMutableDictionary a 
very thin wrapper around it gives 20-30% better performance than our GSIMap 
version.  

- In the profiling I've done, I've yet to find an NSDictionary instance whose 
keys were not strings, and yet we currently optimise for the general case of 
arbitrary objects and not for the strings-keys case.

- Our NSMutableArray does very badly in the push / pop front case.  I had 
another implementation a few years ago that would buffer a few objects in a 
separate array making this fast (amortising the move cost across multiple 
operations and avoiding it entirely if you only push / pop a small number of 
values).  An alternative approach would be to detect this access pattern and 
turn it into an array that stored the variables in reverse.

David

-- Sent from my Difference Engine






reply via email to

[Prev in Thread] Current Thread [Next in Thread]