Seems like you're looking for a free lunch. 'find with' is inherently expensive, because it has to loop over all elements to find which ones satisfy your expression. For your 'a_array.find with (item.address == end_addr)' example that is slow you're comparing apples against oranges. On one side you have an array indexed by address and on the other side you have an array indexed by the item reference itself. You can't draw any conclusions regarding performance from such an experiment...
↧