<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Parallel on [Lou's lab]</title><link>/tags/parallel/</link><description>Recent content in Parallel on [Lou's lab]</description><generator>Hugo -- gohugo.io</generator><language>zh-tw</language><copyright>Copyright ©2020 Lou</copyright><lastBuildDate>Tue, 08 Jul 2025 10:13:51 +0800</lastBuildDate><atom:link href="/tags/parallel/index.xml" rel="self" type="application/rss+xml"/><item><title>Effective Java Item 48：使用 parallel streams 要非常小心</title><link>/posts/book/effective-java-item48/</link><pubDate>Tue, 08 Jul 2025 10:13:51 +0800</pubDate><guid>/posts/book/effective-java-item48/</guid><description>&lt;p>整理 &lt;strong>Effective Java&lt;/strong> 書中 Item 48: Use streams judiciously 心得筆記&lt;/p>
&lt;h2 id="主旨parallel-stream-用錯效能與正確性可能雙雙出問題">主旨：parallel stream 用錯，效能與正確性可能雙雙出問題&lt;/h2>
&lt;p>Java 8 的 stream API 帶來了非常方便的資料處理方式，加上 &lt;code>.parallel()&lt;/code> 方法，更是讓你只用一行就能平行運算聽起來很香。&lt;/p>
&lt;p>但實際上呢？用錯地方，不僅效能沒提升，甚至會程式掛掉。&lt;strong>平行化是進階優化技巧，不是萬靈丹。&lt;/strong>&lt;/p></description></item></channel></rss>