oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.35k stars 1.63k forks source link

[Truffle] Possible Footprint Improvement for DynamicObjectLibrary #4041

Open smarr opened 2 years ago

smarr commented 2 years ago

On TruffleRuby, I am seeing for unit-test code a lot of AST sub trees of the shape:

Cached:
  - AnyKey:
      - MissingKeyIdentity

It seems that reading a missing field requires 3 nodes, and is one of the most common subtrees I see on the ActiveSupport unit tests.

Perhaps there's potential to reduce the footprint for those.

/cc @eregon

eregon commented 2 years ago

cc @woess

smarr commented 10 months ago

@eregon @chumer is this solved with object inlining? (I am just randomly going through old issue in-between meetings)

eregon commented 10 months ago

No, because there are no nodes for DynamicObject yet, only the DynamicObjectLibrary, and Truffle library messages cannot be DSL-inlined.

eregon commented 10 months ago

OTOH DynamicObjectLibrary can internally use DSL node inlining, currently it does so for 4 nodes but not for the rest and currently the structure is still the same as in the description.

chumer commented 9 months ago

We are planning to redo the dynamic object module using regular (sometimes inlinable) nodes, similar to how TruffleString works nowadays. @woess I think this is good feedback we should probably work into the new design.