title: Performance differences: map() vs peek() with setters
body: <p>I wonder if there is any performance differences in two below scenarios - peek() vs map() with return:</p>
  
  <pre><code>Set&lt;Item&gt; convertedItems = items
                  .stream()
                  .filter(item -&gt; ItemType.POSTER.equals(item.getType()))
                  .peek(item -&gt; item.setType(ItemType.LOGO))
                  .collect(toSet());
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Set&lt;Item&gt; convertedItems = items
                  .stream()
                  .filter(item -&gt; ItemType.POSTER.equals(item.getType()))
                  .map(item -&gt; {
                      iitem.setType(ItemType.LOGO);
                      return item;
                  })
                  .collect(toSet());
  </code></pre>
  
  <p>I read several post on stackoverflow about setters in map() vs peek() and I found only one information about performance. It said that map() with return would be worse but without explaining why: <a href="https://stackoverflow.com/questions/35377840/how-to-call-setter-in-chain-of-stream#comment58514142_35377863">How to call setter in chain of Stream</a></p>