FermiumASM

FermiumASM

172k Downloads

Opt proposal: BakedQuad

msparkles opened this issue ยท 0 comments

commented

So first of all, a spark profiler result.
JCBYQnqV16.txt
(Original file extension is .sparkprofile but github is stinky and doesn't like that)

And second of all and very importantly, we have not looked at the actual definition of these functions, we have no idea how to do that in 1.12.2 Forge, let alone with many ASM mods already installed. (context: Nomifactory GTCEu, and we don't feel like submitting a feature request to an open phobe that literally called us slurs during an argument anyways.)

So looking at the profiler results, it seems that a lot of time is spent on a function called UnpackedBakedQuad.pipe. There seems to already be bytecode stuff for that function in place, but we currently lack the knowledge to understand them.

Just purely going by the name and signature it seems that either Mojang or Forge were doing extremely wack functional programming in Java?


For one, is there a way of targeted inlining of .pipe? So instead of piping to a consumer, just, inline the whole thing.

For two, it's also spending a ton of time on VertexBufferConsumer.put (called by .pipe too)
Is there a way to just have a huge vertex bytebuffer+a position counter and let end callers write to that directly?

This is, of course, all speculation. The self-time on these are really not looking great, though, and we don't know of any mods that might have a fix for this that aren't either completely incompatible with everything else or god forbid Optifine.

We're just going by what would most likely be the cause (as deemed by us) of these functions being slow, feel free to correct or dismiss this.