Skip to content

Commit

Permalink
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions truffle/src/main/java/org/jruby/truffle/RubyContext.java
Original file line number Diff line number Diff line change
@@ -109,10 +109,24 @@ public RubyContext(Ruby jrubyRuntime, TruffleLanguage.Env env) {

// Stuff that needs to be loaded before we load any code

/*
* The Graal option TimeThreshold sets how long a method has to become hot after it has started running, in ms.
* This is designed to not try to compile cold methods that just happen to be called enough times during a
* very long running program. We haven't worked out the best value of this for Ruby yet, and the default value
* produces poor benchmark results. Here we just set it to a very high value, to effectively disable it.
*/

if (compilerOptions.supportsOption("MinTimeThreshold")) {
compilerOptions.setOption("MinTimeThreshold", 100000000);
}

/*
* The Graal option InliningMaxCallerSize sets the maximum size of a method for where we consider to inline
* calls from that method. So it's the caller method we're talking about, not the called method. The default
* value doesn't produce good results for Ruby programs, but we aren't sure why yet. Perhaps it prevents a few
* key methods from the core library from inlining other methods.
*/

if (compilerOptions.supportsOption("MinInliningMaxCallerSize")) {
compilerOptions.setOption("MinInliningMaxCallerSize", 5000);
}

2 comments on commit 9fcd6ad

@eregon
Copy link
Member

@eregon eregon commented on 9fcd6ad Apr 11, 2016

Choose a reason for hiding this comment

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

Well done 👍

Sorry, something went wrong.

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

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

Having comments is great. I'd probably indicate what "size of method" means. Is it node count? Is it byte size? Just so those not well-versed in Truffle can follow better.

Sorry, something went wrong.

Please sign in to comment.