CHAPTER 5 - QnA #53
Unanswered
coalong
asked this question in
CHAPTER 5 스트림 활용 - Q&A
Replies: 2 comments
-
A1) 연산 순서가 의미가 있지 않고, 병렬작업이 결과에 영향을 미치는 상황이 아니며 빠른 결과를 내야한다면 parallelStream()을 사용하면 좋지 않을까요? |
Beta Was this translation helpful? Give feedback.
0 replies
-
A1) 윗분의 의견과 같습니다. A2) 스트림이 저장이 아닌 단순히 데이터를 읽는 것이면 무한한 스트림도 데이터를 나눠서 읽을 수 있지 않을까요...? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
p. 175
Q1. Stream API 에서 parallel() 과 parallelStream() 으로 병렬 실행을 할 수 있는데, 언제 병렬 실행하는 것이 좋을까?
Q2. 책에서
map
,filter
같은 상태를 갖지 않는 연산 (stateless operation)과reduce
,sum
,max
같은 상태 크기가 한정적인 연산(bounded stateful operation) 과sorted
과distinct
와 같은 상태 크기가 정해지지 않은 연산 (unbounded stateful operation) 을 설명한다.상태 크기가 정해지지 않은 연산 (unbounded stateful operation)
은 무한 스트림을 사용할 때 문제가 생길 수 있다.sorted
나distinct
같은 연산을 사용할 경우, 문제를 피할 수 있는 방법이 있을까?p 182.
IntStream
, double 요소에 특화된DoubleStream
, long 요소에 특화된LongStream
을 제공한다.Q3. 왜 기본형 특화 스트림은 3가지만 제공할까?
(나머지 (e.g. short, char) 형들에 대해서는 왜 제공하지 않을까)
Beta Was this translation helpful? Give feedback.
All reactions