Ruby 2.0ã®å¤§ããªç¹å¾´ã®1ã¤ã¨ãã¦ãrequireã®é«éåãæãããã¦ãã¾ãã Railséçºã§èµ·åé度ã«ç´çµããã®ã§ãé常ã«ãããããã¤ã³ãã§ãã ã©ã®ãããéããªã£ãã®ããè¶ ç°¡åãªãµã³ãã«ã§è©¦ãã¦ã¿ã¾ããã ã½ã¼ã¹ã³ã¼ãã¯ããã§ãã 1.upto(10000) do |i| require "./lib/a#{i}" end ããããããlib以ä¸ã«a1.rbï½a100000.rbã®ç´10ä¸åã®ãã¡ã¤ã«ãç½®ãã¦ããã¾ãã åãã¡ã¤ã«ã®ä¸èº«ã¯ããããããa1=1ããa2=2ã...ãa100000=100000ãã¨æ¸ãã¦ããã ãã§ãã ã¾ãã¯Ruby 1.9.3ã®çµæããã $ time ruby test.rb (1åç®) real 0m5.247s user 0m4.872s sys 0m0.292s (2åç®) real 0m5.072s user 0m4.788s sys
{{#tags}}- {{label}}
{{/tags}}