From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id EA26317D57CD for ; Sat, 28 Mar 2015 08:12:23 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id A7D00B5D8F0 for ; Sat, 28 Mar 2015 08:20:48 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 7F3D897A826 for ; Sat, 28 Mar 2015 08:20:49 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=sendgrid.me Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p4AE9zqRseIW for ; Sat, 28 Mar 2015 08:20:49 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 3F63D97A820 for ; Sat, 28 Mar 2015 08:20:49 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 9931295243A for ; Sat, 28 Mar 2015 08:20:45 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 81B6512057B; Sat, 28 Mar 2015 08:20:41 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id 47068120520 for ; Sat, 28 Mar 2015 08:20:38 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=Hc+twLowNc37PtbJJMRpPXoGqgY=; b=nOxAsPgKdCBOuqW4ql 1ona4jhwOPEbUAQLtQ1dsZqmJzrqKNoMrYjjxxWAcCh7urMky2l+LI6F07M56z5J 4TlFVUBfteEMlWrCh1y26GIv5PcHKcI7QE0cFx8IeluEZrC3RG5ONQFchOrsvvGT 9cuhr5mAx0fAlIDGrt+8zqzFI= Received: by filter0372p1mdw1.sendgrid.net with SMTP id filter0372p1mdw1.16000.5515E5C214 2015-03-27 23:20:34.742257903 +0000 UTC Received: from herokuapp.com (ec2-54-198-1-244.compute-1.amazonaws.com [54.198.1.244]) by ismtpd-046 (SG) with ESMTP id 14c5d898062.74d.70ef18 Fri, 27 Mar 2015 23:20:34 +0000 (UTC) Date: Fri, 27 Mar 2015 23:20:34 +0000 From: adrien.siami@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 43068 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 10015 X-Redmine-Issue-Author: tenderlovemaking X-Redmine-Sender: Intrepidd X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: OOF Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6cX0L6E97AzM9vmr5wTEYRh7hP/4YtbzSXFa LPDaTsr6GSK31lSmfYBFEwa4SQ3OM2Wv7IGOY9feydlx/2BBQHJLJrS4TOinvhHX0c3eJeS9cLV9LA Sb19rPw1+h6babHGkhzdyZ58QtVB1TVxvMcY X-ML-Name: ruby-core X-Mail-Count: 68660 Subject: [ruby-core:68660] [Ruby trunk - Bug #10015] Performance regression in Dir#[] X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #10015 has been updated by Adrien Siami. I've noticed a significant slowdown of a rails app when using ruby 2.2.1 rather than 2.1.5. A slow page was running in 16 seconds with 2.2.1 where it was running in less than 3 seconds with 2.1.5 I tested this very simple benchmark : ~~~ require 'benchmark' puts Benchmark.realtime { 800000.times do Dir['/tmp'] end } ~~~ it runs in 3.1289695860032225 secs with 2.2.1 and 2.403 secs with 2.1.5 Is this issue still present ? ---------------------------------------- Bug #10015: Performance regression in Dir#[] https://bugs.ruby-lang.org/issues/10015#change-51953 * Author: Aaron Patterson * Status: Closed * Priority: Normal * Assignee: * ruby -v: ruby 2.2.0dev (2014-02-04 trunk 44802) [x86_64-darwin13.0] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- r44802 seems to have introduced a performance regression in Dir#[]. Here is the test program: ~~~ruby require 'benchmark' puts Benchmark.realtime { glob = "minitest/*_plugin.rb{,.rb,.bundle}" $LOAD_PATH.map { |load_path| Dir["#{File.expand_path glob, load_path}"] }.flatten.select { |file| File.file? file.untaint } } ~~~ Here is the test time for me: ~~~ $ ruby -v test.rb ruby 2.2.0dev (2014-02-04 trunk 44801) [x86_64-darwin13.0] 0.000341 $ ruby -v test.rb ruby 2.2.0dev (2014-02-04 trunk 44802) [x86_64-darwin13.0] 0.009333 ~~~ r44801 seems much faster than r44802. -- https://bugs.ruby-lang.org/