1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

19 commits

Author SHA1 Message Date
schneems
e1a7260640 Use block variable instead of global
```ruby
require 'benchmark/ips'

Benchmark.ips do |x|
  x.report("$&") {
    "foo".sub(/f/) { $&.upcase }
  }
  x.report("block var") {
    "foo".sub(/f/) {|match| match.upcase }
  }
end

```

```
Calculating -------------------------------------
                  $&    48.658k i/100ms
           block var    49.666k i/100ms
-------------------------------------------------
                  $&    873.156k (± 9.3%) i/s -      4.331M
           block var    969.744k (± 9.2%) i/s -      4.818M
```

It's faster, and gets rid of a few "magic" global variables
2015-06-01 19:44:40 -05:00
Rafael Mendonça França
4c614651b5 Do not use deprecated exists? method 2014-10-13 10:59:43 -03:00
Rafael Mendonça França
46f80b5094 Document the propose of tools/profile 2014-10-13 10:59:12 -03:00
Rafael Mendonça França
33361a50eb Revert "Merge pull request #17247 from igas/fix-deprecations"
This reverts commit 997f1575f7, reversing
changes made to f919d5f5ea.

See https://github.com/rails/rails/pull/17247#issuecomment-58895078
2014-10-13 10:55:55 -03:00
Igor Kapkov
9114d65800 remove unused tools/profile 2014-10-13 21:43:20 +08:00
Benjamin Fleischer
3cbeb8d8ea Fail profiler fast when input is not a ruby file
[ci skip]
2014-07-25 13:41:18 -05:00
Benjamin Fleischer
54a4065074 Optionally add String extensions for ruby-prof printer option
[ci skip]
2014-07-25 13:41:18 -05:00
Benjamin Fleischer
f36c46754f Encapsulate tools/profile functionality in CodeTools::Profiler
Fix bug in path expansion of input filepath

[ci skip]
2014-07-25 13:41:18 -05:00
Benjamin Fleischer
65a227beda Correct tools/profile usage example
[ci skip]
2014-07-25 13:25:42 -05:00
Arun Agrawal
0d062f02e9 Removing Gem.source_index [ci skip] 2013-07-13 12:05:52 +02:00
Jeremy Kemper
00791bfb64 Remove REE GC stats since master is 1.9.3 2012-10-26 08:24:27 -07:00
rochefort
a43213c534 fix Example: Rename tools/profile_requires -> tools/profile 2012-10-06 01:32:02 +09:00
Kornelius Kalnbach
d8c1949684 require "rubygems" is obsolete in Ruby 1.9.3 2012-05-13 14:47:25 +02:00
Prem Sichanugrist
f1637bf2bb Remove Active Resource source files from the repository
Dear Active Resource,

It's not that I hate you or anything, but you didn't get much attention lately. There're so many alternatives out there, and I think people have made their choice to use them than you. I think it's time for you to have a big rest, peacefully in this Git repository.

I will miss you,

@sikachu.
2012-03-13 14:55:44 -04:00
Jeremy Kemper
4883082ff1 Support an extra profile printer arg 2010-06-24 01:08:12 -07:00
Jeremy Kemper
7b730a2f1b Show GC time and # of runs too 2010-06-23 16:11:13 -07:00
Jeremy Kemper
577034decb Ensure require and load are private - h/t apeiros 2010-04-24 10:38:41 -07:00
Jeremy Kemper
50cdb654ac Use call stack printer if available 2010-04-04 11:56:49 -07:00
Jeremy Kemper
d73f2ff434 Rename tools/profile_requires -> tools/profile since we do both require and ruby-prof profiling. 2009-05-27 01:11:33 -05:00
Renamed from tools/profile_requires (Browse further)