Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 86
- Log:
Initial import of I2, an Instiki clone.
- Author:
- adh
- Date:
- Mon Oct 16 10:40:36 +0100 2006
- Size:
- 930 Bytes
- Properties:
- Property svn:executable is set
1 | #!/usr/local/bin/ruby |
2 | if ARGV.empty? |
3 | $stderr.puts "Usage: profiler 'Person.expensive_method(10)' [times]" |
4 | exit(1) |
5 | end |
6 | |
7 | # Keep the expensive require out of the profile. |
8 | $stderr.puts 'Loading Rails...' |
9 | require File.dirname(__FILE__) + '/../config/environment' |
10 | |
11 | # Define a method to profile. |
12 | if ARGV[1] and ARGV[1].to_i > 1 |
13 | eval "def profile_me() #{ARGV[1]}.times { #{ARGV[0]} } end" |
14 | else |
15 | eval "def profile_me() #{ARGV[0]} end" |
16 | end |
17 | |
18 | # Use the ruby-prof extension if available. Fall back to stdlib profiler. |
19 | begin |
20 | require 'prof' |
21 | $stderr.puts 'Using the ruby-prof extension.' |
22 | Prof.clock_mode = Prof::GETTIMEOFDAY |
23 | Prof.start |
24 | profile_me |
25 | results = Prof.stop |
26 | require 'rubyprof_ext' |
27 | Prof.print_profile(results, $stderr) |
28 | rescue LoadError |
29 | require 'profiler' |
30 | $stderr.puts 'Using the standard Ruby profiler.' |
31 | Profiler__.start_profile |
32 | profile_me |
33 | Profiler__.stop_profile |
34 | Profiler__.print_profile($stderr) |
35 | end |