On Wed, 4 Sep 2024 14:18:09 GMT, Claes Redestad <redes...@openjdk.org> wrote:
> > If so, then this amounts to a fairly minimal and direct code path, thus I > > approached this as being an "obvious" (as opposed to theoretical) > > improvement. > > I agree that it looks like the typical path is trivial, but I don't have the > full picture to understand when we might do more complicated work here. It > would be nice to have some reasonably realistic benchmark to lean on. I wrote a trivial scratch file which exercises the code using a regular code builder and it did indeed use the expected path, FWIW. I'm honestly not sure what (if any) valid circumstances would cause this particular code to run on a label whose contest is not the code builder itself, so if anyone has any thoughts on that, please share. > @dmlloyd I think we might need a benchmark that uses > `ClassFile.of(StackMapsOption.DROP_STACK_MAPS)` to build a class with method > with code, and supply the stack maps to generate. That is the best way to > measure the gains from this patch. (Something like what we do in > ProxyGenerator, but proxy generation has too many uncertainties) I'll see if I can get the benchmarks in `test/micro/org/openjdk/bench/jdk/classfile` working. It looks like there may be one or more of them which would reach into this code. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20841#issuecomment-2329302010