{"title":"\u975e\u540c\u671f\u30d6\u30fc\u30e0\u306b\u4e57\u3063\u3066\u975e\u540c\u671fmap\u3092\u8003\u3048\u3066\u307f\u305f","author_name":"Sixeight","width":"100%","description":"require 'benchmark' module Enumerable def amap map {|e| Thread.new { yield e } }.map(&:value) end end ary = [1, 2, 3, 4, 5] res = {} Benchmark.bm(4) do |x| x.report('map') { res[:map] = ary.map {|e| sleep 1; e } } x.report('amap') { res[:amap] = ary.amap {|e| sleep 1; e } } end p [:map, res[:map]] p\u2026","image_url":null,"type":"rich","blog_url":"https://blog.nishimu.land/","author_url":"https://blog.hatena.ne.jp/Sixeight/","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","categories":["ruby"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.nishimu.land%2Fentry%2F20081218%2F1229563863\" title=\"\u975e\u540c\u671f\u30d6\u30fc\u30e0\u306b\u4e57\u3063\u3066\u975e\u540c\u671fmap\u3092\u8003\u3048\u3066\u307f\u305f - \u3061\u306a\u307f\u306b\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://blog.nishimu.land/entry/20081218/1229563863","height":"190","version":"1.0","published":"2008-12-18 10:31:03","blog_title":"\u3061\u306a\u307f\u306b"}