ここ最近は並列化による処理速度アップを色々試しています。 Railsプロジェクトのデータに少々不備があることに気づいたので、それを修正するために該当データを抽出しようと思って雑にループを回したら、データ量が多いせいか、全然終了しませんでした。業を煮やした私は、これも並列化してしまおう!と思って並列化の情報を集めることに。 Rubyでの並列処理は、parallelというgemを使うと並列処理がすごく簡単にできました。 github.com parallelのいいところ parallelのいいところは、 並列処理したい対象の配列データを渡すだけでいい map, each, any?, all? などに対応している マルチプロセス、マルチスレッドの両方に対応している というところでしょうか。 簡単な使い方の例 Parallelに対して、配列を渡したら、自動的にCPUの数だけプロセスをフォークして