antlr / intellij-plugin-v4

An IntelliJ plugin for ANTLR v4
https://plugins.jetbrains.com/plugin/7358-antlr-v4
BSD 3-Clause "New" or "Revised" License
468 stars 104 forks source link

Fix some hidden allocation hotspots. #554

Closed KitsuneAlex closed 2 years ago

KitsuneAlex commented 2 years ago

This commit fixes some redundant branches, v-table lookups and an allocation hotspot caused by implicit boxing/unboxing. I'll be adding more optimizations to this until it's merged but this already dropped RAM usage a good bit and released some GC pressure.

Cheers.

parrt commented 2 years ago

Cool. thanks. Oh we use the Linux DCO now not the contributors.txt :) Please check out https://github.com/antlr/intellij-plugin-v4/pull/554/checks?check_run_id=6442612723

parrt commented 2 years ago

Wow. did this really make a diff in memory?

KitsuneAlex commented 2 years ago

I am going to do some more profiling and post some results later :) Also, just saw that ^^ Thanks :)

KitsuneAlex commented 2 years ago

I ammended my sign-offs, does the workflow need to be re-triggered?

parrt commented 2 years ago

I set it to pass for ease, since you signed the contribs. :) will examine later.

KitsuneAlex commented 2 years ago

As i mentioned, imma keep skimming through the code while looking at VisualVM, maybe i can plug some more hotspots.

KitsuneAlex commented 2 years ago

This sign-off workflow is still super confusing to me. Exuse my clumsyness xD

parrt commented 2 years ago

no prob. just make sure to use -s on your git commits :)

parrt commented 2 years ago

These changes might be useful but real issue is antlr's algo on this I think.

KitsuneAlex commented 2 years ago

For sure, i just wanna get as much fixes in while i'm at it, regardless of their size. Also i just messed something up, gonna fix that really quick.

KitsuneAlex commented 2 years ago

I am sorry i have to ask again, but does the sign-off name have to match my GitHub username?

parrt commented 2 years ago

I think the email address Hass to be one associated with your GitHub account

KitsuneAlex commented 2 years ago

That's weird, that is the case already.

parrt commented 2 years ago

It’s probably the previous commits that is screwing this up. There are instructions about resetting and recomittting but we can fake our way to victory if necessary on this one

KitsuneAlex commented 2 years ago

I'll ammend the signoffs to these tomorrow :)

KitsuneAlex commented 2 years ago

Okay, i'm closing this "failed" PR for now since i need to ammend all the signoffs anyways. I started writing an optimization starting at the ANTLR runtime level, so i'll come back to this once that's done. You'll see a new, bigger PR soon :)