Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up test by webmock 22.53sec to 611.60 millis #162

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

stoivo
Copy link
Contributor

@stoivo stoivo commented May 29, 2024

⋊> ~/D/c/t/fixtures on v2 ⨯ time be rake test                                                                                                                                                                                                               16:20:14
(in /Users/simon/Downloads/css_parser)
/Users/simon/.asdf/installs/ruby/3.2.2/bin/ruby -w -I"lib" /Users/simon/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/rule_set/declarations/test_value.rb" "test/rule_set/test_declarations.rb" "test/test_css_parser_basic.rb" "test/test_css_parser_loading.rb" "test/test_css_parser_media_types.rb" "test/test_css_parser_misc.rb" "test/test_css_parser_offset_capture.rb" "test/test_css_parser_regexps.rb" "test/test_helper.rb" "test/test_merging.rb" "test/test_rule_set.rb" "test/test_rule_set_creating_shorthand.rb" "test/test_rule_set_expanding_shorthand.rb"
Run options: --seed 58367

# Running:

...........................................................................................................................................................................................................

Finished in 21.866189s, 9.2837 runs/s, 30.0464 assertions/s.

203 runs, 657 assertions, 0 failures, 0 errors, 0 skips

________________________________________________________
Executed in   22.53 secs      fish           external
   usr time  448.40 millis  139.00 micros  448.27 millis
   sys time  153.05 millis  984.00 micros  152.06 millis

⋊> ~/D/c/t/fixtures on v2-webmock ⨯ time be rake test                                                                                                                                                                                                               16:20:01
(in /Users/simon/Downloads/css_parser)
/Users/simon/.asdf/installs/ruby/3.2.2/bin/ruby -w -I"lib" /Users/simon/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/rule_set/declarations/test_value.rb" "test/rule_set/test_declarations.rb" "test/test_css_parser_basic.rb" "test/test_css_parser_loading.rb" "test/test_css_parser_media_types.rb" "test/test_css_parser_misc.rb" "test/test_css_parser_offset_capture.rb" "test/test_css_parser_regexps.rb" "test/test_helper.rb" "test/test_merging.rb" "test/test_rule_set.rb" "test/test_rule_set_creating_shorthand.rb" "test/test_rule_set_expanding_shorthand.rb"
Run options: --seed 27120

# Running:

...........................................................................................................................................................................................................

Finished in 0.047695s, 4256.2113 runs/s, 13775.0288 assertions/s.

203 runs, 657 assertions, 0 failures, 0 errors, 0 skips

________________________________________________________
Executed in  611.60 millis    fish           external
   usr time  356.27 millis    0.09 millis  356.17 millis
   sys time  106.73 millis    1.31 millis  105.42 millis

Why and what is being done.

Pre-Merge Checklist

  • CHANGELOG.md updated with short summary

Copy link
Contributor

@grosser grosser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ no more accidental requests too :D

gem 'memory_profiler'
gem 'rake'

gem 'maxitest'
gem 'webmock', '~> 3.23'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not be needed

Suggested change
gem 'webmock', '~> 3.23'
gem 'webmock'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have learned that is always good to add a minimum version so you know you want downgrade by mistake. Also now you can run bundle update and things should work but with depricitions if any. Then do the major bump up.

but I will remove it if you want

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bundler warns on downgrades so I usually don't add any
it adds a lot of clutter when every gem has a version :)
... just leave it I can remove them all whenever they cause an issue

@grosser
Copy link
Contributor

grosser commented May 29, 2024

just rubocop failing

Comment on lines 9 to 12
def fixture(*path)
Pathname(File.expand_path('fixtures', __dir__))
.join(*path)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should get removed now

⋊> ~/D/c/t/fixtures on v2-webmock ⨯ time be rake test                                                                                                                                                                                                               16:20:14
(in /Users/simon/Downloads/css_parser)
/Users/simon/.asdf/installs/ruby/3.2.2/bin/ruby -w -I"lib" /Users/simon/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/rule_set/declarations/test_value.rb" "test/rule_set/test_declarations.rb" "test/test_css_parser_basic.rb" "test/test_css_parser_loading.rb" "test/test_css_parser_media_types.rb" "test/test_css_parser_misc.rb" "test/test_css_parser_offset_capture.rb" "test/test_css_parser_regexps.rb" "test/test_helper.rb" "test/test_merging.rb" "test/test_rule_set.rb" "test/test_rule_set_creating_shorthand.rb" "test/test_rule_set_expanding_shorthand.rb"
Run options: --seed 58367

# Running:

...........................................................................................................................................................................................................

Finished in 21.866189s, 9.2837 runs/s, 30.0464 assertions/s.

203 runs, 657 assertions, 0 failures, 0 errors, 0 skips

________________________________________________________
Executed in   22.53 secs      fish           external
   usr time  448.40 millis  139.00 micros  448.27 millis
   sys time  153.05 millis  984.00 micros  152.06 millis

⋊> ~/D/c/t/fixtures on v2-webmock ⨯ time be rake test                                                                                                                                                                                                               16:20:01
(in /Users/simon/Downloads/css_parser)
/Users/simon/.asdf/installs/ruby/3.2.2/bin/ruby -w -I"lib" /Users/simon/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/rule_set/declarations/test_value.rb" "test/rule_set/test_declarations.rb" "test/test_css_parser_basic.rb" "test/test_css_parser_loading.rb" "test/test_css_parser_media_types.rb" "test/test_css_parser_misc.rb" "test/test_css_parser_offset_capture.rb" "test/test_css_parser_regexps.rb" "test/test_helper.rb" "test/test_merging.rb" "test/test_rule_set.rb" "test/test_rule_set_creating_shorthand.rb" "test/test_rule_set_expanding_shorthand.rb"
Run options: --seed 27120

# Running:

...........................................................................................................................................................................................................

Finished in 0.047695s, 4256.2113 runs/s, 13775.0288 assertions/s.

203 runs, 657 assertions, 0 failures, 0 errors, 0 skips

________________________________________________________
Executed in  611.60 millis    fish           external
   usr time  356.27 millis    0.09 millis  356.17 millis
   sys time  106.73 millis    1.31 millis  105.42 millis
@stoivo
Copy link
Contributor Author

stoivo commented Jun 3, 2024

fixed

@grosser grosser merged commit 557af8b into premailer:v2 Jun 3, 2024
6 checks passed
@grosser
Copy link
Contributor

grosser commented Jun 3, 2024

FYI misc small fixes #163

.vscode should go into your global ~/.gitignore

@stoivo stoivo deleted the v2-webmock branch June 4, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants