From: jward@... Date: 2016-03-03T22:11:52+00:00 Subject: [ruby-core:74120] [Ruby trunk Bug#12139] return OpenSSL::Random.random_bytes(n) call takes to long. OpenSSL:: bug on windows. Issue #12139 has been updated by Justin Ward. Yui NARUSE wrote: > Your issue sounds related with https://wiki.openssl.org/index.php/Random_Numbers#Windows_Issues > But [Bug 2100 the heap walk issue](https://rt.openssl.org/Ticket/Display.html?id=2100&user=guest&pass=guest) is closed. > > Anyway maybe SecureRandom, RSpec actually calls, should use [CryptGenRandom](https://msdn.microsoft.com/en-us/library/windows/desktop/aa379942%28v=vs.85%29.aspx) instead of openssl. CryptGenRandom would be an excellent solution in my opinion :) ---------------------------------------- Bug #12139: return OpenSSL::Random.random_bytes(n) call takes to long. OpenSSL:: bug on windows. https://bugs.ruby-lang.org/issues/12139#change-57266 * Author: Justin Ward * Status: Feedback * Priority: Normal * Assignee: * ruby -v: 2.2.4 * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- I have been a windows dev for a while now. I have never solved this rails startup issue. Running one Rspec test takes rails 22 seconds to load on my PC. When I (temporarily) comment out the line in securerandom.rb and replace it with a hardcoded return the startup time is reduced to 10 seconds. ```ruby #return OpenSSL::Random.random_bytes(n) return "\xD3\x04F\f0\xD6{G\xB9\x81" ``` I can duplicate this on a windows 7 and windows 10 PC. I have the lastest version of OpenSSL (1.02) installed. Tickets like this have been reported before, but they get closed without being solved for unknown reasons. Please share the joy of Ruby with us PC users :). See this more more info: http://stackoverflow.com/questions/29984838/openssl-causing-very-slow-rails-boot-time-on-windows/35749120#35749120 -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>