File tree Expand file tree Collapse file tree 3 files changed +30
-13
lines changed
Expand file tree Collapse file tree 3 files changed +30
-13
lines changed Original file line number Diff line number Diff line change 1+ name : Bench
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ name : Benchmarks
13+ steps :
14+ - uses : actions/checkout@v6
15+ - uses : ruby/setup-ruby@v1
16+ with :
17+ ruby-version : ' 3.4'
18+ - name : Install dependencies
19+ run : bundle install
20+
21+ - name : Generators
22+ run : RUBYOPT="-W0" bundle exec ruby benchmark/generators.rb
23+ - name : Require
24+ run : RUBYOPT="-W0" bundle exec ruby benchmark/load.rb
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3- require 'benchmark/ips'
4- require 'benchmark'
3+ require "benchmark"
54
6- if defined? ( Faker )
7- raise 'faker is defined before bench '
8- end
5+ ms = Benchmark . realtime do
6+ require 'faker'
7+ end * 1000
98
10- path = File . expand_path ( "#{ File . dirname ( __FILE__ ) } /load_faker.rb" )
11-
12- Benchmark . ips do |x |
13- x . report ( 'Loading Time' ) do
14- system ( "ruby #{ path } " )
15- end
16- end
9+ puts "took #{ ms } ms to laod"
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33if defined? ( Faker )
4- raise 'faker is already defined... '
4+ raise 'faker is defined before load '
55end
66
77load ( File . expand_path ( "#{ File . dirname ( __FILE__ ) } /../lib/faker.rb" ) )
You can’t perform that action at this time.
0 commit comments