Skip to content

Avoid allocations when calling Resource.liftK#4589

Merged
durban merged 2 commits intotypelevel:series/3.xfrom
nmichael44:CreateCachedVersionOfLiftK
May 4, 2026
Merged

Avoid allocations when calling Resource.liftK#4589
durban merged 2 commits intotypelevel:series/3.xfrom
nmichael44:CreateCachedVersionOfLiftK

Conversation

@nmichael44
Copy link
Copy Markdown
Contributor

Create a cached version of liftK so avoid allocations when method Resource.liftK is called. This is using the usual trick (relying on erasure).

This is a minor optimization (every little helps), but feel free to close the PR if you don't feel it's worth it.

durban
durban previously approved these changes May 1, 2026
Copy link
Copy Markdown
Contributor

@durban durban left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment thread kernel/shared/src/main/scala/cats/effect/kernel/Resource.scala Outdated
@durban durban self-requested a review May 1, 2026 09:08
@durban
Copy link
Copy Markdown
Contributor

durban commented May 1, 2026

Wait, is this not your commit?

@durban durban dismissed their stale review May 1, 2026 09:10

Unclear commit authorship.

@nmichael44
Copy link
Copy Markdown
Contributor Author

Wait, is this not your commit?

@durban I am not sure what you mean. Of course it's my commit. Please explain.

@durban
Copy link
Copy Markdown
Contributor

durban commented May 1, 2026

@nmichael44 The github UI is showing both commits as belonging to another user. A certain @neophytos-m.

@nmichael44
Copy link
Copy Markdown
Contributor Author

@nmichael44 The github UI is showing both commits as belonging to another user. A certain @neophytos-m.

@durban Same guy :). Sorry, I don't know how that happened. Let me try to fix that.

@nmichael44 nmichael44 force-pushed the CreateCachedVersionOfLiftK branch from 0f9662c to c2b358b Compare May 1, 2026 12:56
@nmichael44
Copy link
Copy Markdown
Contributor Author

@nmichael44 The github UI is showing both commits as belonging to another user. A certain @neophytos-m.

@durban Same guy :). Sorry, I don't know how that happened. Let me try to fix that.

@durban Should be fixed now. Please take another look.

Copy link
Copy Markdown
Contributor

@durban durban left a comment

Choose a reason for hiding this comment

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

Thanks

@durban durban merged commit 486d9a8 into typelevel:series/3.x May 4, 2026
37 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants