Skip to content

Performance Issue with version 1.5.0 #886

Closed

Description

@TeamNautilus

Hello

We updated omniauth gem from version 1.3.2 to 1.5.0. We noticed a weird increment on our rack Middleware. Our monitoring software showed us a call to OmniAuth::Builder#call that took in average 6.37ms, which is more than all our previous middleware times.

We tried different configurations of the gems omniauth and hashie:
hashie: 3.5.3, 3.4.6
omniauth: 1.3.2, 1.4.2, 1.5.0

and the most updated match that worked for us was omniauth 1.4.2 with hashie 3.4.6 (now OmniAuth::Builder#call takes around 1.8ms).

thank you

Activity

  1. tmilewski commented on Feb 16, 2017

    @tmilewski
    Member

    I'm happy to look into this but would you mind providing more information per the ISSUE_TEMPLATE? https://github.com/omniauth/omniauth/blob/master/.github/ISSUE_TEMPLATE.md

  2. TeamNautilus commented on Feb 16, 2017

    @TeamNautilus
    Author

    Hi

    Configuration

    ruby-version:

    • 2.3.1

    providers:

    • 'omniauth-facebook'
    • 'omniauth-google-oauth2'

    framework:

    • rails 5.0.1

    Expected Behavior

    method OmniAuth::Builder#call should take around 1.8ms as for previous version (ominauth 1.4.2 with hashie 3.4.6)

    Actual Behavior

    method OmniAuth::Builder#call takes in average 6.37ms with ominauth 1.5.0

    if you need more info please tell us.
    Thank you!

  3. tmilewski commented on Feb 17, 2017

    @tmilewski
    Member

    Apologies on the delay. You're absolutely right and it does appear to be hashie. I'm sitting on 1.6.0, I'll release that now with looser hashie requirement allowing you to define 3.4.6 in your Gemfile.

    3.4.6

    › bundle exec rake perf:ips
    Warming up --------------------------------------
                    ips     1.109k i/100ms
    Calculating -------------------------------------
                    ips     11.301k (± 4.9%) i/s -     56.559k in   5.017976s
    

    3.5.3

    › bundle exec rake perf:ips        
    Warming up --------------------------------------
                     ips   178.000  i/100ms
    Calculating -------------------------------------
                     ips      1.786k (± 6.3%) i/s -      8.900k in   5.003601s
    
  4. tmilewski commented on Feb 17, 2017

    @tmilewski
    Member

    @michaelherold Just wanted to make you aware of this. I'll try and dig in more later. I've just been pretty slammed at work. Thanks!

  5. michaelherold commented on Feb 18, 2017

    @michaelherold
    Contributor

    Thanks for pinging me @tmilewski - we'll look into it.

  6. michaelherold commented on Feb 18, 2017

    @michaelherold
    Contributor

    I tracked down the performance regression. It was me being silly and doing a methods.include? instead of a respond_to? to detect whether a key collided with a method. You can see the fix at hashie/hashie#411.

  7. tmilewski commented on Feb 18, 2017

    @tmilewski
    Member

    @michaelherold Thanks! For reference:

    3.5.4

    › bundle exec rake perf:ips                          
    Warming up --------------------------------------
                     ips   979.000  i/100ms
    Calculating -------------------------------------
                     ips     10.290k (± 4.6%) i/s -     51.887k in   5.053437s
    
    › bundle exec rake perf:ips
    Warming up --------------------------------------
                     ips   998.000  i/100ms
    Calculating -------------------------------------
                     ips     10.422k (± 4.6%) i/s -     52.894k in   5.086560s
    
  8. TeamNautilus commented on Feb 21, 2017

    @TeamNautilus
    Author

    Hi all.

    We were able to try your changes and we wanted to let you know that the problem seem to be solved on our side.

    We just wanted to thank you all, both for the solution and the quickness of the fix.

    Good work guys!

  9. michaelherold commented on Feb 21, 2017

    @michaelherold
    Contributor

    Thanks for checking back in @TeamNautilus - it's always good to hear when things go well! 😄

  10. michaelherold commented on Feb 24, 2017

    @michaelherold
    Contributor

    @tmilewski I wanted to give you a heads up that we're slightly modifying the way that we're looking up collisions in hashie/hashie#415. I did some performance testing, which you can see on that issue, and it looks like it won't affect OmniAuth performance. We're trying our best to do our due diligence!

  11. added theissue type on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions