You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not quite sure how much time it takes us to parse the AOT IR in (with deku), so this may be a low priority thing --- but we can almost certainly reduce the run-time ART IR "parse time" cost to zero.
At the moment every time we run a yk interpreter, we use deku to parse the AOT IR into Rust structs. Instead of this, we can probably do the deku phase at compile-time (which might mean "link-time"). In essence, each struct in aot_ir.rs would be both deku-fied and serde-fied e.g.:
At compile-time/link-time, we would read in all the IR serialised by ykllvm, probably slurping it straight out of an executable. We'd then use deku to parse that data into struct instances, and then use serde to deserialise things back into the executable. At run-time we would then use serde's zero-copy to reference the data in the read-only part of the executable without ever parsing/copying anything.
The text was updated successfully, but these errors were encountered:
I wonder if there's a zero copy serialisation format with implementations in both C++ and Rust?
I think that would be hard, in the sense that you'd probably end up with some very non-idiomatic Rust structs (since C++ would probably dominate). It would also mean rewriting more of our code, whereas I think the approach I'm suggesting might only take a very simple Rust program that opens an executable, imports yk, and that's about it.
and it works. I haven't pushed this all the way through, but I think this means this will end up being fairly easy. My guess is that using something like goblin to read the executable, slurp in the existing "ykllvm.yk_ir section and deku -> serde it, won't be too difficult.
I'm not quite sure how much time it takes us to parse the AOT IR in (with deku), so this may be a low priority thing --- but we can almost certainly reduce the run-time ART IR "parse time" cost to zero.
At the moment every time we run a yk interpreter, we use deku to parse the AOT IR into Rust structs. Instead of this, we can probably do the deku phase at compile-time (which might mean "link-time"). In essence, each
struct
inaot_ir.rs
would be both deku-fied and serde-fied e.g.:At compile-time/link-time, we would read in all the IR serialised by ykllvm, probably slurping it straight out of an executable. We'd then use deku to parse that data into struct instances, and then use serde to deserialise things back into the executable. At run-time we would then use serde's zero-copy to reference the data in the read-only part of the executable without ever parsing/copying anything.
The text was updated successfully, but these errors were encountered: