Skip to content

Opportunities for performance gains in new collections #520

Closed
@retronym

Description

@retronym

(Grab bag of things I've noticed)


Override keysIterator as appropriate to avoid creating tuples, as in

Tuple2 scala.collection.immutable.BitmapIndexedMapNode.getPayload(...) line: 160	10
   Tuple2 scala.collection.immutable.MapKeyValueTupleIterator.next() line: 584	10
   Object scala.collection.immutable.MapKeyValueTupleIterator.next() line: 577	10
   Object scala.collection.MapOps$$anon$1.next() line: 166	5
      Object scala.collection.Iterator$$anon$9.next() line: 495	5
      Growable scala.collection.mutable.Growable.addAll(...) line: 50	5


Create bulk version of incl/excl to reuse a single SetEffect / MapEffect result holder when we're being called from allAdd / removeAll


I think we get rid of SetEffect / MapEffect altogether by looking at reference equality of the returned nodes and by encoding the "value updated" boolean in the returned node.


LinkedHashMap could directly implement some of the *InPlace mutation methods.


Reapply the List.filter optimizations


Create AnyRefArrayOps to avoid Array_apply/update/length. The specialization trick used so far for ArrayOps#fold doesn't help in the reference array case.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions