I have some very high performance critical code, which at a high level takes a bunch of decision by doing some floating point comparisons or simple predicates. The code can be written in the form of a decision tree. Basically each nodes does a predicate check and then decides which path to take until we reach some leaf node.
To improve performance instead of having this decision tree , i generate some if-else code blocks that gets compiled when programs run (basically i generate code for the entire decision tree since i know the predicates beforehand). This does improve performance quite a bit. Now the next optimization i want to do is modify the code at runtime i.e in the old world of no code generation and having a decision trees with nodes , i could have copied the tree and short circuited/jumped over some nodes , hence compressing the tree and made overall computation faster. But in the generated code world , is there any tool that can achieve the same by modifying my generated if-else code based on some partial runtime data available during computation. Also what are the performance implication of modifying run time code.