MinecraftForge / AccessTransformers

Antlr4 definition for MCP / Forge Access Transformers
GNU Lesser General Public License v2.1
14 stars 12 forks source link

Further optimisations #19

Closed PaintNinja closed 8 months ago

PaintNinja commented 8 months ago

Supersedes #17.

The rewritten parser without ANTLR is great, but there's some small areas for improvement which this PR tackles.

Baseline (before this PR) 1st run ``` Benchmark Mode Cnt Score Error Units AccessTransformerListBenchmark.testATLoad avgt 2 942.797 us/op AccessTransformerListBenchmark.testAtContainsHit avgt 2 0.020 us/op AccessTransformerListBenchmark.testAtContainsMiss avgt 2 2.216 us/op ``` 2nd run ``` Benchmark Mode Cnt Score Error Units AccessTransformerListBenchmark.testATLoad avgt 2 955.704 us/op AccessTransformerListBenchmark.testAtContainsHit avgt 2 0.022 us/op AccessTransformerListBenchmark.testAtContainsMiss avgt 2 2.194 us/op ``` 3rd run ``` Benchmark Mode Cnt Score Error Units AccessTransformerListBenchmark.testATLoad avgt 2 958.059 us/op AccessTransformerListBenchmark.testAtContainsHit avgt 2 0.063 us/op AccessTransformerListBenchmark.testAtContainsMiss avgt 2 2.221 us/op ```
More finals, list and array optimisations 1st run ``` AccessTransformerListBenchmark.testATLoad avgt 2 935.084 us/op AccessTransformerListBenchmark.testAtContainsHit avgt 2 0.046 us/op AccessTransformerListBenchmark.testAtContainsMiss avgt 2 2.216 us/op ``` 2nd run ``` Benchmark Mode Cnt Score Error Units AccessTransformerListBenchmark.testATLoad avgt 2 915.717 us/op AccessTransformerListBenchmark.testAtContainsHit avgt 2 0.046 us/op AccessTransformerListBenchmark.testAtContainsMiss avgt 2 2.227 us/op ``` 3rd run ``` Benchmark Mode Cnt Score Error Units AccessTransformerListBenchmark.testATLoad avgt 2 939.692 us/op AccessTransformerListBenchmark.testAtContainsHit avgt 2 0.062 us/op AccessTransformerListBenchmark.testAtContainsMiss avgt 2 2.264 us/op ```
Optimised containsClassTarget() 1st run ``` Benchmark Mode Cnt Score Error Units AccessTransformerListBenchmark.testATLoad avgt 2 976.981 us/op AccessTransformerListBenchmark.testAtContainsHit avgt 2 0.016 us/op AccessTransformerListBenchmark.testAtContainsMiss avgt 2 0.001 us/op ``` 2nd run ``` Benchmark Mode Cnt Score Error Units AccessTransformerListBenchmark.testATLoad avgt 2 972.055 us/op AccessTransformerListBenchmark.testAtContainsHit avgt 2 0.016 us/op AccessTransformerListBenchmark.testAtContainsMiss avgt 2 0.001 us/op ``` 3rd run ``` Benchmark Mode Cnt Score Error Units AccessTransformerListBenchmark.testATLoad avgt 2 961.999 us/op AccessTransformerListBenchmark.testAtContainsHit avgt 2 0.016 us/op AccessTransformerListBenchmark.testAtContainsMiss avgt 2 0.001 us/op ```
Technici4n commented 8 months ago

It's interesting how the benchmarks show that nothing was actually optimized, making this a code cleanup PR at best.