æãæåãªãã³ããã¼ã¯ãµã¤ã "The Computer Language Benchmarks Game" ã«ãããææ°ã®ã©ã³ãã³ã°ã§
Ruby 1.9 㯠Python3, PHP, JRuby ã追ãæãã¹ã¯ãªããè¨èªã¨ãã¦ãããã¯ã©ã¹ã®å¤ãå©ãåºãã¾ããã
5/4ã®æç¹ã§ã¯æä¸ä½ã«è¿ãã£ãã®ã§å¤§ããåé²ãã¦ãã¾ãã
1ã¤ã®ãããã§520%ã®é«éåãéæ
ãã®é«éåã¯ç§ãfastaã¨ãããã³ããã¼ã¯ã®ããã°ã©ã ãæ¹åãããã¨ã«ããå®ç¾ãã¾ããã
å°ãåRubyã®ãã³ããã¼ã¯ãæ¸ããã¨ã«ããã£ã¦ãã¾ããã
ä»ã®äººã®ããã°ã©ã ãçµ±è¨ãçºãã¦ããã¨ããfastaã«é¢ãã¦Pythonãç°å¸¸ã«éããã¨ã«æ°ã¥ãã¾ããã
ä»ã®ã¹ã¯ãªããè¨èªã®ããã50åéããã¢ã«ã´ãªãºã ãæ¹è¯ããã¦ãã¾ããã
ãã®2ã¤ã®ã³ã¼ããæ¯è¼ããã¨ãããã®ã§ãããå¦çãéè¤ãã¦ããç®æã«ã¤ãã¦äºåã«ãã¼ãã«ãä½æãã¦ãã¾ãã
ãã®ã¢ã«ã´ãªãºã ãRubyã«portããã¨ããRubyã§ãPythonã¨ã»ã¼åæ§ã®ã¹ãã¼ãã«ãªãã¾ããã
Perlã«è² ããçç±
æåã®ã¹ã¯ãªã¼ã³ã·ã§ããã§ã¯Perlã«ã¯è² ãã¦ãã¾ã£ã¦ãã¾ããããã¯Perlã§ã¯åæ§ã®ã¢ã«ã´ãªãºã ã®æ¹åãè¡ã£ãããã°ã©ã ã6/9ã«æ稿ããã¦ã
ããã¨ç§ã®Rubyã®ãã®ã®2ã¤ã®ããã°ã©ã ãä»æ¥(7/12)ã«åãè¾¼ã¾ããããã§ãã
ã¹ã³ã¢ãåä¸ãããæ¹æ³
"The Computer Language Benchmarks Game" ã§ã¯
- åãã³ããã¼ã¯ã§æéã®è¨èª(ããã¦ãã¯C++)ã®ä½åã®ã¹ãã¼ããããã£ãããç®åº
- ãã®ä¸å¤®å¤ãç®åº
ã¨ããæ¹æ³ã§è¨èª(å¦çç³»)ã®ã¹ã³ã¢ãæ±ãã¦ãã¾ãã
ä¾ãã°ç¾å¨ã® Ruby 1.9 ã®ã¹ã³ã¢ã¯36.77ã§ãã®ã§
Ruby 1.9 v.s C++ GNU g++
ãããã¿ã¦35ä»è¿ãåºæºã«é«éåããå¿
è¦ãããã¾ãã
ã¾ãfasta, regex-dna, pidigits, reverse-complement, binary-treesã¯ä¸å¤®å¤ãããå¤ãå°ããã®ã§ãã以ä¸é«éåãã¦ãæå³ãããã¾ããã
ãã³ããã¼ã¯æ°ã¯10ãªã®ã§ã¹ã³ã¢ã¯ä¸éã«è¿ã
(binary-trees + k-nucleotide) / 2 = 35.5
ã§æ±ãããã¾ããå¾ã£ã¦ãã®2ã¤ã¯å°ãã§ãé«éåããã°ã¹ã³ã¢ã®æ¹åã«ç´çµãã¾ãã
ããæéããé ãspectral-norm, n-body, fannkuch-redux, mandelbrotã¯k-nucleotideã®50ãããããã«å°ããªå¤ã«ã§ããªãéãé«éåãã¦ãæå³ãããã¾ããã
ãã®ããã«ã¹ã³ã¢ã®ç®åºæ¹æ³ãèæ ®ãããã¨ã§å¹ççã«ã©ã³ãã³ã°ãä¸æããããã¨ãã§ãã¾ãã
ã¾ã¨ãããããã¯ãªããã³ããã¼ã¯ã®ã¹ã³ã¢ãå®éã®é度ã¨ãã¾ãé¢ä¿ããªãã®ã
- "The Computer Language Benchmarks Game" ã¯ã²ã¼ã ã§ã! ããã°ã©ãã«ã¨ã£ã¦æé«ã«æ¥½ããã²ã¼ã ã§ã!
- ã ããå®éã®è¨èªã®é度ã¨ã¯ãã¾ãé¢ä¿ããªããã¨ããããããã§ã!