_recursive_compile_class is specific to jit so would be help to include add the “jit” category in the question. My intuition as to why it must recompile everytime is that RPC calls allow for user defined logic with conditionals/branching so it would not be possible to compile only once, but I am not completely sure of this.
cc: @wanchaol