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

reduce를 사용하는 것이 왜 반복문보다 장점을 가지는 것일까? #44

Open
injoon2019 opened this issue Mar 29, 2022 · 2 comments
Assignees
Labels
ch5 about chapter 5

Comments

@injoon2019
Copy link

문제

reduce를 사용하는 것이 왜 반복문보다 장점을 가지는 것일까?

선정 배경

책에서는 병렬화하기 쉽다고 하기 때문에 장점이 있다고 하였다. 그렇다면 병렬화를 사용하지 않는다면 어떤 장점이 있을까.

관련 챕터

Chp.5

@injoon2019 injoon2019 added the ch5 about chapter 5 label Mar 29, 2022
@injoon2019
Copy link
Author

image

책에서는 reduce를 이용하면 내부 반복이 추상화되면서 내부 구현에서 병렬로 reduce를 실행할 수 있게 된다고 하지만 실제적인 성능 차이는 뚜렷하게 보이지 않음 (parallelStream을 쓰면 뚜렷함)

@injoon2019
Copy link
Author

image

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

No branches or pull requests

1 participant