mirror of
https://github.com/enso-org/enso.git
synced 2024-12-24 05:12:31 +03:00
f02213ae2b
Fixes the regression introduced by #9070 in `org.enso.benchmarks.generated.Collections.list_meta_fold` benchmark. # Important Notes As can be seen on the graph in IGV: ![image](https://github.com/enso-org/enso/assets/14013887/31b6ceca-4909-4a8f-987f-b456b3fb0a1b) For some reason, `EqualsSimpleNode` is POLYMORPHIC. That seems to be the most visible performance problem. First, I tried to introduce `ConditionProfile` with: ```diff diff --git a/engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/meta/EqualsNode.java b/engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/meta/EqualsNode.java index b368fb7fe..57274b37e 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/meta/EqualsNode.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/meta/EqualsNode.java @@ -9,6 +9,7 @@ import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.interop.ArityException; import com.oracle.truffle.api.nodes.Node; +import com.oracle.truffle.api.profiles.ConditionProfile; import org.enso.interpreter.dsl.AcceptsError; import org.enso.interpreter.dsl.BuiltinMethod; import org.enso.interpreter.node.EnsoRootNode; @@ -46,6 +47,7 @@ public final class EqualsNode extends Node { @Child private EqualsSimpleNode node; @Child private TypeOfNode types; @Child private WithConversionNode convert; + private final ConditionProfile equalsProfile = ConditionProfile.create(); private static final EqualsNode UNCACHED = new EqualsNode(EqualsSimpleNodeGen.getUncached(), TypeOfNode.getUncached(), true); @@ -85,7 +87,7 @@ public final class EqualsNode extends Node { public boolean execute( VirtualFrame frame, @AcceptsError Object self, @AcceptsError Object other) { var areEqual = node.execute(frame, self, other); - if (!areEqual) { + if (!equalsProfile.profile(areEqual)) { var selfType = types.execute(self); var otherType = types.execute(other); if (selfType != otherType) { ``` But that did not resolve the issue. My second attempt was to enable splitting for `EqualsSimpleNode` with `@com.oracle.truffle.api.dsl.ReportPolymorphism` annotation, which seems to resolve the issue. The benchmark is back to its original score, and `EqualsSimpleNode` is no longer POLYMORPHIC. |
||
---|---|---|
.. | ||
interpreter-dsl-test/src/test/java/org/enso/interpreter/dsl/test | ||
language-server | ||
launcher/src | ||
polyglot-api/src | ||
runner | ||
runtime | ||
runtime-benchmarks/src/main | ||
runtime-compiler/src/main | ||
runtime-fat-jar/src/main/java | ||
runtime-instrument-common/src | ||
runtime-instrument-id-execution/src/main/java/org/enso/interpreter/instrument | ||
runtime-instrument-repl-debugger/src/main/java/org/enso/interpreter/instrument | ||
runtime-instrument-runtime-server/src/main/java/org/enso/interpreter/instrument | ||
runtime-integration-tests/src/test | ||
runtime-language-arrow/src | ||
runtime-language-epb/src | ||
runtime-parser/src | ||
runtime-test-instruments/src/main/java | ||
README.md |
The Enso Engine
The Enso engine is the codebase responsible for compiling and executing Enso code, as well as providing language server functionality to users of the language. It is subdivided into two major components:
- Language Server: The Enso language service.
- Polyglot API: The truffle-boundary safe API for communication between the language server and the runtime.
- Runner: The command-line interface for Enso.
- Runtime: The compiler and interpreter for Enso.