-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an easy work to work out if you are on an optimizing runtime #47
Comments
I don't like isInterpreter as the GraalRuntime also uses an interpreter. I also don't like isOptimizing because it does not match the term compilation that we use everywhere else (CompilerDirectives, CompilerAsserts).
So I'd propose: |
I'm fine with |
I'd propose |
Maybe |
There already is |
I didn't know about that. I don't think it's exactly the same thing, as you could chose to run Graal with optimisation but no profiling, but I think you're right I can repurpose for a basic check to see if people have got Graal. |
I would also like to have a proper And |
IMHO, |
@woess yes my opinion is that these things should not be merged. |
How many more If "isProfilingEnabled isn't really a property of the runtime but should be an independent option" - then current |
@jtulach it is |
The real question is rather should this be part of |
Configuring Truffle API behavior by options located in |
The alternative of having ´isProfilingEnabled´ is to call in the TruffleRuntime for each profile individually. Besides beeing verbose it is also not extensible because also guest languages might do things differently if profiling is not enabled (it might disable all kinds of stuff). Graal runtimes still want to disable isProfilingEnabled for benchmarking its overhead. So merging isProfilingEnabled and isOptimizingRuntime would mean loosing this ability. |
isOptimizingRuntime()/isCompilingRuntime() is a way to tell whether the runtime can optimize/compile Truffle code. I think we should have such a method so that you don't have to resort to fragile hacks like using getName() or getClass().getName() to get to this information. Profiling on the other hand could be enabled/disabled regardless of the runtime, potentially even more fine-grained (e.g. per CallTarget). I'm not sure we need isProfilingEnabled() in TruffleRuntime at all, but I'm not proposing to change anything there right now. |
My preferred long term solution:
On a general note: TruffleRuntime is interface. Adding methods to it complicates everything. Callers need to ready for the method not being there and throwing an error when called. |
Happy with the long term solution.
In general yes, but not in this case, right? It's an interface that only we implement, and only in Truffle and Graal, so it doesn't matter that we're adding methods to it unless we care about a hypothetical alternative |
@chrisseaton it does matter because it binds the truffle graal runtime to a specific version. So newer versions cannot run with older Truffle and vice versa. |
Ah right yes of course. |
@jtulach Your long term plan sounds good. Fits all the requirements. GL devs can query the TruffleOption and the TruffleRuntime flag to develop their own profiles. |
…OM/truffle:extend-interop-dsl to master * commit '90e7979dbd56100962dbc96cd522e1ba96fd2468': Test if interop exception flow through Polyglot engine without wrapping SL should expect an InteropException if function arguments have an invalid type Let interop exception flow through Polyglot engine without wrapping. This allows language implementations to test proper error handling Unwrap UnsupportedSpecializationException from an InteropException in SymbolInvokerImpl and re-throw it. Some Unittests (e.g. in SL) expect UnsupportedSpecializationExceptions. Clean up and better document interop implementation in SL Fix broken throw-statement of UnsupportedTypeException in Execute message resolutions. Add cause to InteropException.
Current solution is to check for checking Graal keyword in TruffleRuntime#getRuntime() and Engine#getImplementationName(). |
We want to avoid people running JRuby+Truffle on a standard JVM, or even a JVM with Graal but the wrong flags, and being disappointed about performance. When JRuby+Truffle starts we check that the
TruffleRuntime
is a Graal runtime, and if it isn't we present a warning. Doing this requires looking at the undocumented runtime name.I wonder if it would be useful to add a method
boolean isOptimizing()
toTruffleRuntime
. This hides the implementation detail that it is Graal being used, and leaves the door open for any other hypothetical optimising Truffle runtimes, while still allowing us to show our warning.Another option would be the inverse -
boolean isInterpreter()
.The text was updated successfully, but these errors were encountered: