Skip to content

OpenSSL::PKCS5.pbkdf2_hmac_sha1 slowness #1073

Closed
@mauricioszabo

Description

@mauricioszabo

OpenSSL::PKCS5.pbkdf2_hmac_sha1 is about 10x slower than Ruby 1.9's version:

# On Ruby 1.9.3:
[4] pry(main)> Benchmark.bmbm { |x| 
  x.report { 
    OpenSSL::PKCS5.pbkdf2_hmac_sha1("Foo", "Bar", 2000, 1024) 
  }
}
Rehearsal ------------------------------------
   0.140000   0.000000   0.140000 (  0.133370)
--------------------------- total: 0.140000sec

       user     system      total        real
   0.130000   0.000000   0.130000 (  0.130077)

# On JRuby 1.7.4:
[4] pry(main)> Benchmark.bmbm { |x| 
  x.report { 
    OpenSSL::PKCS5.pbkdf2_hmac_sha1("Foo", "Bar", 2000, 1024) 
  }
}
Rehearsal ------------------------------------
   2.200000   0.000000   2.200000 (  1.922000)
--------------------------- total: 2.200000sec

       user     system      total        real
   2.040000   0.000000   2.040000 (  1.837000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions