Skip to content

Turbo Mode#40

Merged
gbenroscience merged 18 commits intomasterfrom
methd-handles
Mar 18, 2026
Merged

Turbo Mode#40
gbenroscience merged 18 commits intomasterfrom
methd-handles

Conversation

@gbenroscience
Copy link
Copy Markdown
Owner

ParserNG, in this series of commits has been given a turbo mode which is enabled by the usage of MethodHandles.
This turbo mode has 2 parts: One for Matrix Algebra and one for scalar computations, statistics and variable arithmetic etc.

…apable of handling both complex scalar calculus and heavy linear algebra with minimal GC pressure
…erNG's full suite of functions with sub 100ns latency
…ctions like tri_mat(M) and replacing them with anon1, anon2 etc. This is a breaking change. ParserNG will henceforth not accomodate that behaviour again
@gbenroscience gbenroscience merged commit 0da76ef into master Mar 18, 2026
0 of 6 checks passed
@gbenroscience gbenroscience deleted the methd-handles branch March 18, 2026 22:31
@judovana
Copy link
Copy Markdown
Contributor

The GHAs are not running ("billing issue" .. how come on personal account?). Manual testing went fine? How about mvn release?-)
Was the method handle really so great improvement? Were you able to measure it? Nice set of commits though. TY!

@gbenroscience
Copy link
Copy Markdown
Owner Author

Hi @judovana, I had some time on my hands, so I decided to fulfill my promise on updating ParserNG for speed.
The normal mode is by far faster now, will plot graphs very smoothly. Beats exp4J and com.expression.parser on every benchmark.
Its about 1.5x slower than Janino though, but by far more fully featured than it.

The Turbo Mode:
Beats the normal mode, and everything slower than the normal mode on every benchmark.
Beats Janino(the so-called gold standard) on most expressions(constant expressions and single variable expressions and multivariable expressions that are constant heavy or single variable heavy)
On balanced multi variable expressions however, Janino is 6ns to 40ns faster than the turbo mode.
Still planning some updates to see if that hurdle can be cleared.

And yes MethodHandles are really something in JDK 17+

The tests:
I have done all releases on maven central up to version 1.0.1, currently.
All tests pass on my own computers, but I think tests do not pass on Github perhaps because of actions that require some server resources?
Would be nice if you could look into this.. Thanks. I am sure your app will benefit from the speed updates!
Enjoy

@gbenroscience
Copy link
Copy Markdown
Owner Author

As to the measurements, I am targeting another release soon.
Will show you updated benchmarks later

@judovana
Copy link
Copy Markdown
Contributor

Cool! Good work!

The GHAs fails due to The job was not started because your account is locked due to a billing issue. Which is something I have never seen. On private projects public it should not appear because github is supporting open development and is donating quite a few free cycles for all. The organization repos are of ocurse paying, and in that moment billing issue can appear, although i had never encountered it before. Is your acount an organization? I Doubt. Is it private? I doubt... So probably rise a ticket in github with request to unlock? In worst you will hear the reason. There is this thread: https://github.com/orgs/community/discussions/186091 which is suggesting possible causes (and resolved on its own), and netsearch is providing even more. => rise a ticket :)

@gbenroscience
Copy link
Copy Markdown
Owner Author

gbenroscience commented Mar 23, 2026

The account is not organizational in nature.
I suspect maybe because I am not a premium user of Github Copilot?
Could they wish for me to upgrade? I have finished the free tier that they make available and they want me to upgrade. But Github Copilot should not affect this, no?

@judovana
Copy link
Copy Markdown
Contributor

I have many personal projects, am not using copilot, some of them have GHAs, and they just work:( I have never tried the copilot, so maybe it can indeed be the cause. That would still lead to ticket. Btw, I had recently issue with fork routing on projects - unlike same issue about year and half ago (when human took it and solved it)- it was handled by copilot and I was politely explained why it can not be solved. So brace yourself.

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.

2 participants