I have a code that calls
code_ex = Meta.parse("""begin\n$(code)\nend""")
@RuntimeGeneratedFunction(
:(function (__virtual__::Virtual)
# [...]
try
$code_ex
catch e
# [...]
end
return nothing
end)
)
which leads to around 75% of the total execution time (which includes a lot of other things) being spent here, specifically in converting the function’s body to an internal id in the constructor (line 61), which is spent on serializing the expression (line 284) to hash it.
What’s the best way to “skip” this step? I can guarantee (for my own package) knowing whether a function was already generated in advance much faster – of course I could build up my own cache on top of that, but I wanted to see if there was an “official” way to, e.g., provide custom ids, etc.
edit 01: Also, even when adding a manual cache, the overhead of creating the id once is a considerable amount of time that I would like to prevent.