Skip to content

optimize ChunkProviderSuperPatcher: don't create ClassNode in shouldTransformClass#288

Open
danyadev wants to merge 1 commit into
GTMEGA:masterfrom
danyadev:optimize-transforming
Open

optimize ChunkProviderSuperPatcher: don't create ClassNode in shouldTransformClass#288
danyadev wants to merge 1 commit into
GTMEGA:masterfrom
danyadev:optimize-transforming

Conversation

@danyadev
Copy link
Copy Markdown

Depends on FalsePattern/FalsePatternLib/pull/50
Will need to bump both compile and runtime dependency version after it's released

Now falsepattern takes only 3% of GTNH transforming time during client load, or only 150ms, which is 10 times less compared to initial measure:
image

For a reference, after only the first FalsePatternLib PR MergeableTurboTransformer.transform took 12.4ms for this particular class instead of 1ms now

Initial behavior: create a ClassNode, walk over all methods, then for every method walk over all instructions and search for CLASS_Chunk owner + METHOD_getBiomeArray name + ()[B descriptor

New behavior: first search for CLASS_Chunk in constant pool entries, then (if there's at least one match) search for METHOD_getBiomeArray in constant pool entries

It's a bit broader because we don't search for a descriptor, and method owner & method name are not necessarily connected to each other anymore, but potentially a bit larger subset of matched classes is still infinitely better than creating a ClassNode for every single class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant