This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'https://rubygems.org' | |
| gem 'multi_json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.jboss.shrinkwrap.api.ShrinkWrap; | |
| import org.wildfly.swarm.config.undertow.FilterConfiguration; | |
| import org.wildfly.swarm.config.undertow.configuration.ResponseHeader; | |
| import org.wildfly.swarm.config.undertow.server.host.FilterRef; | |
| import org.wildfly.swarm.container.Container; | |
| import org.wildfly.swarm.undertow.UndertowFraction; | |
| import org.wildfly.swarm.undertow.WARArchive; | |
| public class Main { | |
| public static void main(String... args) throws Exception { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- jvm-npm.js.orig 2015-09-16 09:19:07.007874748 -0400 | |
| +++ jvm-npm.js 2015-09-15 16:25:25.607810957 -0400 | |
| @@ -237,7 +237,7 @@ | |
| function resolveCoreModule(id, root) { | |
| var name = normalizeName(id); | |
| var classloader = java.lang.Thread.currentThread().getContextClassLoader(); | |
| - if (classloader.findResource(name)) | |
| + if (classloader.findResource(name, false)) | |
| return { path: name, core: true }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| num_runtimes = 10 | |
| puts "Creating runtimes..." | |
| num_runtimes.times do | |
| instance = org.jruby.Ruby.newInstance | |
| instance.evalScriptlet <<-EOS | |
| require "socket" | |
| server = TCPServer.new(0) | |
| Thread.new do | |
| begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/async.js b/lib/async.js | |
| index 394c41c..8d91ab5 100644 | |
| --- a/lib/async.js | |
| +++ b/lib/async.js | |
| @@ -832,6 +832,120 @@ | |
| return q; | |
| }; | |
| + async.indexedQueue = function (worker, concurrency) { | |
| + if (concurrency === undefined) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| autoload :ProxyObject, 'proxy_object.rb' | |
| require 'proxy_object' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ bin/jruby -S gem install atomic | |
| Fetching: atomic-1.1.16-java.gem (100%) | |
| Successfully installed atomic-1.1.16-java | |
| 1 gem installed | |
| $ bin/jruby ~/tmp/rubygems_java_ext_broken.rb | |
| absolute paths are broken | |
| relative paths work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'benchmark' | |
| require 'json/ext' | |
| NUM_THREADS = 40 | |
| NUM_PARSES = 20_000 | |
| def run_test(json) | |
| puts Benchmark.measure { | |
| threads = NUM_THREADS.times.map do | |
| Thread.new do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'benchmark' | |
| require 'json/ext' | |
| NUM_THREADS = 40 | |
| NUM_PARSES = 20_000 | |
| def run_test(json) | |
| puts Benchmark.measure { | |
| threads = NUM_THREADS.times.map do | |
| Thread.new do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I've added more comments to this code to make it more clear what | |
| everything does. | |
| ActiveSupport::Testing::Isolation runs its tests in parallel, and | |
| JRuby has real multithreading. So, what happens under JRuby is | |
| the first test executes, sets the environment variables, and | |
| spawns a child process. In parallel, a second test executes, sets | |
| the environment variables to different values, and spawns another | |
| child process. It's this setting of environment variables that is | |
| a problem - the second test is being run in parallel and sets the |