-
Notifications
You must be signed in to change notification settings - Fork 6k
Replace internal Stream usage with for loops #7154
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
Comments
Hi @rwinch, do you think this is good for |
Hello @rwinch, I have an experience with stream api and others streams such as rxjava, I can take it in work. Where can I start? is stream api used in all modules? |
Thanks for the offer @kostya05983! A search shows the following locations contain an import to stream APIs. Note that we should only change private internal code. Please note:
|
Thanks for a detailed guide.
|
Don't change the method signatures of public methods. Changing how the method is implemented is fine. |
Ok, @rwinch , I didn't change the signature. I think, the request is ready for review, please see it, when you have a time. |
First version of replacing streams Fix wwwAuthenticate and codestyle Fix errors in implementation to pass tests
First version of replacing streams fix wwwAuthenticate and codestyle fix errors in implementation to pass tests Fix review notes Remove uneccessary final to align with cb Short circuit way to authorize Simplify error message, make code readably Return error while duplicate key found Delete check for duplicate, checkstyle issues Return duplicate error
Summary
While some prefer the readability of using the Stream APIs, the GC overhead of creating additional objects (including intermediate objects) can cause significant decrease in performance There are some simple benchmarks that illustrate the problem.
We should replace Stream usage with for loops throughout Spring Security's code base.
Related gh-7155
The text was updated successfully, but these errors were encountered: