Skip to content

Conversation

@retronym
Copy link
Member

@retronym retronym commented Apr 28, 2020

Iterate the entry set of the mutable map without tuples and avoid the need for tuples for each entry when building the immutable Map result.

@scala-jenkins scala-jenkins added this to the 2.12.12 milestone Apr 28, 2020
@retronym retronym force-pushed the topic/group-by-foreach-entry branch 3 times, most recently from b3f1674 to 742bbb5 Compare April 29, 2020 00:38
@retronym retronym changed the title cbac5f080a (Jason Zaugg, 6 minutes ago) Tuple-free Map building where it makes sense Avoid Tuple Allocation in groupBy Apr 29, 2020
@retronym retronym marked this pull request as draft April 29, 2020 00:40
@retronym retronym force-pushed the topic/group-by-foreach-entry branch from 742bbb5 to e831e46 Compare April 29, 2020 00:43
@diesalbla diesalbla added the library:collections PRs involving changes to the standard collection library label Apr 29, 2020
@mkeskells
Copy link
Contributor

is this still live?

@retronym
Copy link
Member Author

retronym commented May 4, 2020

This still has some value separate to #8948, but it a an bigger/uglier patch and might not make meet the cost/benefit calculation. I thought I'd leave it as a draft PR for now.

*/
package scala.collection.mutable

private[collection] trait EfficientMapBuilder[K, V] extends ((K, V, (K, V)) => Unit) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-)
This is probably useful in several other places

e.g. for the caller to override def ++=(xs: TraversableOnce[(A, B)]): in HashMapBuilder, conversion from Map4, MapBuilder ( when it switches to use a HashMapBuilder), and for anything else that is a HasForEachEntry

@retronym retronym modified the milestones: 2.12.12, 2.12.13 Jun 23, 2020
@mkeskells mkeskells mentioned this pull request Sep 8, 2020
6 tasks
@dwijnand dwijnand modified the milestones: 2.12.13, 2.12.14 Oct 16, 2020
@dwijnand
Copy link
Member

dwijnand commented Dec 4, 2020

Closing for inactivity.

@dwijnand dwijnand closed this Dec 4, 2020
@SethTisue SethTisue removed this from the 2.12.14 milestone Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

library:collections PRs involving changes to the standard collection library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants