<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>inamori</author_name>
  <author_url>https://blog.hatena.ne.jp/inamori/</author_url>
  <blog_title>inamori’s diary</blog_title>
  <blog_url>https://inamori.hateblo.jp/</blog_url>
  <categories>
    <anon>プログラミング</anon>
    <anon>Python</anon>
    <anon>数学</anon>
  </categories>
  <description>Modegramming Style: Scalazの型クラスこれを読んでいてふと思ったこと。 結合則が成り立つ場合、畳込み（fold）を行うときリストを分割して並列で計算させれば速くなります。例えばsumですね。1〜100を足し合わせるときに、1〜50と51〜100に分けてそれぞれを別プロセスで計算して、最後にその2つを足し合わせます。 from multiprocessing import Pool import functools import time NUM_PROCESS = 2 def sum_range(first, last, k): return sum(xrange(fi…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20120517%2Fp1&quot; title=&quot;結合則が成り立たない場合のfold系の高速化 - inamori’s diary&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/i/inamori/20120517/20120517221253.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-05-17 00:00:00</published>
  <title>結合則が成り立たない場合のfold系の高速化</title>
  <type>rich</type>
  <url>https://inamori.hateblo.jp/entry/20120517/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
