Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

=str Avoid subMaterialization when the provided recover source is empty. #31669

Merged
merged 1 commit into from Oct 28, 2022

Conversation

He-Pin
Copy link
Member

@He-Pin He-Pin commented Oct 15, 2022

Extracted from pr #31639
onTop of #31675

  1. avoid the materialization when the provided recovered to source is emtpy
  2. make use of NotApplied.

@johanandren
Copy link
Member

Something I didn't think of before, doesn't the optimization currently the mapMatVal is not invoked?

mySource.etc.recoverWith { case _: Throwable => Source.empty.mapMaterializedValue(something) } }

Not entirely sure if that is fine because source is empty or if we need to check just like we do for the singleSource optimizations.

@He-Pin
Copy link
Member Author

He-Pin commented Oct 17, 2022

@johanandren For empty Source this kind of optimization should be fine as always return a new Source. And for singleSource, there is an l.traversalSoFar eq EmptyTraversal guard, so that should be fine too?

@johanandren
Copy link
Member

Ah, ofc. Yes, that's good, the optimization only works with no attributes etc added on empty but that's fine. 👍

@He-Pin He-Pin marked this pull request as draft October 18, 2022 15:39
@He-Pin He-Pin marked this pull request as ready for review October 18, 2022 17:22
@He-Pin
Copy link
Member Author

He-Pin commented Oct 19, 2022

@patriknw ping, in case this miss the release 2.7.0

@patriknw
Copy link
Member

sorry, we have already closed the door for 2.7.0, but can be included later

@He-Pin
Copy link
Member Author

He-Pin commented Oct 27, 2022

@patriknw is there any ETA this get merged?

Copy link
Member

@patriknw patriknw left a comment

Choose a reason for hiding this comment

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

LGTM

@patriknw patriknw merged commit e2b16e2 into akka:main Oct 28, 2022
@patriknw patriknw added this to the 2.7.1 milestone Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants