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

Rewrite Smile buffer recycling (SmileBufferRecycler) to use new (2.16) RecyclerPool, allow configuring use of non-ThreadLocal based pools #399

Closed
cowtowncoder opened this issue Sep 30, 2023 · 2 comments

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Sep 30, 2023

Now that jackson-core added pluggability of recycler pools (see FasterXML/jackson-core#1089 ), and also provides a set of reusable implementations (see FasterXML/jackson-core#1064) we can tackle Smile-specific additional recycling: it also needs to allow re-configuring esp. to work with Project Loom where ThreadLocal based pooling really does not work well. This is likely to also help with Android usage, where SoftRefernences (used by default Smile recycler, in addition to ThreadLocal) does not work as well as vanilla J2SE JDKs.

So let's try to get this done for 2.16.

Class to change is SmileBufferRecycler.
For 2.16 we should still default to traditional recycler, but for 2.17+ should probably change the default. This allows for early adopters to switch over sooner, while we get feedback on how pooling works, best default to use.

@cowtowncoder cowtowncoder changed the title Rewrite Smile buffer recycling to use new (2.16) RecyclerPool, allow configuring for non-ThreadLocal based pools Rewrite Smile buffer recycling (SmileBufferRecycler) to use new (2.16) RecyclerPool, allow configuring for non-ThreadLocal based pools Sep 30, 2023
@cowtowncoder cowtowncoder changed the title Rewrite Smile buffer recycling (SmileBufferRecycler) to use new (2.16) RecyclerPool, allow configuring for non-ThreadLocal based pools Rewrite Smile buffer recycling (SmileBufferRecycler) to use new (2.16) RecyclerPool, allow configuring use of non-ThreadLocal based pools Sep 30, 2023
@cowtowncoder
Copy link
Member Author

Working on PR for this one (#402) I did a bit of local performance testing and had hard time finding actual speed up even for small documents (about 300 bytes). Looking at implementations, generator-side in particular seems less than useful, only recycling default-sized (64 entries) buffers.

So I think I'll try alternate PR in which recycling is completely removed instead.

@cowtowncoder
Copy link
Member Author

Did instead #403, closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant