[Adium-devl] HOM

Colin Barrett timber at lava.net
Sat Nov 11 21:53:52 UTC 2006


I agree, the contact controller does seem like a good candidate,  
simply for cleaning up the massive, massive amounts of code we have in  
there.

-Colin

On Nov 11, 2006, at 11:24 AM, David Smith wrote:

> 	I'm not really sure I see the issue; the speed is clearly fine (oh
> noes, 0.002 second difference), and HOM can be used incrementally
> where it makes sense. The contact controller in particular seems like
> a good candidate, given all of the iteration over the list that it  
> does.
>
> 							David
>
> On Nov 11, 2006, at 6:38 AM, Colin Barrett wrote:
>
>> On Nov 11, 2006, at 4:28 AM, Ofri Wolfus wrote:
>>
>>> First of all, unit (and speed) tests are included with the source so
>>> anyone can see the results on their own machine. On my eMac with
>>> 1.25 GHz G4, 768MB RAM and 10.4.7 the results of this example with
>>> an array of 3 objects are (each test was performed 1000 times and
>>> the results are the average times):
>>> NSEnumerator: 0.000010 sec
>>> -objectAtIndex: 0.000005 sec
>>> -selectWhere: 0.000013 sec
>>> -selectWhere: with a cached Message instance: 0.000005 sec
>>>
>>> For large arrays (with 10000 strings) the results are:
>>> NSEnumerator: 0.005581 sec
>>> -objectAtIndex: 0.006068 sec
>>> -selectWhere: 0.007683 sec
>>> -selectWhere: with a cached Message instance: 0.007740 sec
>>>
>>> With that being said, I the differences between the iterations vary
>>> based on the iteration method (e.g. -selectWhere: vs -rejectWhere:)
>>> and the collection being used. I think I can safely say that for
>>> really large collections HOM is a bit faster, but for small
>>> collections it's a bit slower. Anyhow, I think these slight
>>> differences in speed are not something that'll be noticeable.
>>
>> It looks like HOM is slower on that large array than NSEnumerator is.
>> Also, why is the cached version slower than the non cached one?
>>
>> Performance aside, I think it would be tough to graft HOM on to our
>> already existing codebase. It looks great if you're developing
>> something from scratch and can be very HOMful, but I can see how
>> putting it in this late in the game would result in a kind of  
>> "stapled
>> on" look to the API. Then again, you may have some excellent
>> suggestions for refactoring -- don't let us stop you. If you're
>> serious about trying to refactor parts of Adium to use HOM, I'd be
>> interested to see you do some work in a branch on it :)
>>
>> -Colin
>>
>>
>> _______________________________________________
>> Adium-devl mailing list
>> Adium-devl at adiumx.com
>> http://adiumx.com/mailman/listinfo/adium-devl_adiumx.com
>
>
> _______________________________________________
> Adium-devl mailing list
> Adium-devl at adiumx.com
> http://adiumx.com/mailman/listinfo/adium-devl_adiumx.com





More information about the devel mailing list