Skip to content

Releases: gbenroscience/ParserNG

Vector API and Bulk Evaluator - Expression Evaluation will never be the same in Java again

Choose a tag to compare

@gbenroscience gbenroscience released this 21 Jun 01:30

Full Changelog: v2.0.0...v2.0.2

Guess who the kid on the block is? Vector API bulk evaluator(SIMDVectorTurboEvaluator)and its compatibility partner, VectorTurboEvaluator. Both run bulk evaluations at roughly same speed(faster than Janino), and come with workers out of the box! VectorTurboEvaluator works because its code is mechanically sympathetic to the hardware running it,so auto-vectorization occurs.

Math evaluation will never be the same again on the JVM!

Desktop/C2 JIT - Math Expression Benchmark

Expression: 12*x1 + 3*x2 - 4*x3 + 5*x1 - x2 - 4*x3 + 2*x1 + x2
Mode: avgt, 30 iterations

Engine dataSize time (ns/op)
Janino 1,000,000 9.81ns
parser-ng-simd 1,000,000 7.49ns
Janino 67,108,864 9.65ns
parser-ng-simd 67,108,864 7.78ns

On Redmi 12(Android), VectorTurboEvaluator evaluated:
sin(z-x)+3*sin(5*x^2 + 4*y^2)

Mobile/ART - Redmi 12 Helio G88

Expression: sin(z-x)+3*sin(5*x^2 + 4*y^2)

dataSize time (ns/op)
30 8235ns
3000000 903.4ns

Notes:

  1. Small batches <1k hit interpreter overhead + JIT warmup
  2. 3M elements = steady state after ART JIT compiles hot loop
  3. No jdk.incubator.vector on Android. Performance limited by 128-bit NEON + A75 cores

Desktop/C2 + JDK24 Vector API - Intel i5-1135G7

AVX2, 2 cores, cache-hot

dataSize Kernel time (ns/op)
40000 Gelu 4.82ns
40000 Swiglu 10.61ns

Notes:

  1. 40k elements = 200x200 matrix, steady state after C2 JIT
  2. JDK24 --add-modules jdk.incubator.vector required for peak numbers
  3. JDK21 ~15% slower. No AVX2 = ~2x slower
Platform CPU Expression Engine dataSize time (ns/op)
Desktop i7-6500U AVX2 2x sin + mul + pow parser-ng-simd 1M 40ns
Desktop i5-1135G7 AVX2 Gelu parser-ng-simd Vector API 40k 4.82ns
Mobile Helio G88 NEON 2x sin + mul + pow parser-ng-simd ART 3M 903.4ns

Bug fixes in Standard mode's Matrix Algebra

Choose a tag to compare

@gbenroscience gbenroscience released this 20 Jun 15:32

Full Changelog: v1.2.0...v1.2.1
Version 1.2.1 fixes bugs in Matrix Algebra in the standard mode.

Matrix Algebra

Choose a tag to compare

@gbenroscience gbenroscience released this 20 Jun 14:00

Version 1.2.0 introduces pure Matrix algebra into ParserNG standard. Its great performance is not at par with what ParserNG Turbo can do( with MatrixTurboEvaluator), in terms of memory allocation optimization and matrix evaluation speed, but it ensures that Matrix Algebra is fully available alongside matrix functionality on ParserNG Standard also.

Full Changelog: v1.1.6...v1.2.0

v1.1.6

Choose a tag to compare

@gbenroscience gbenroscience released this 20 Jun 13:58

Full Changelog: v1.1.5...v1.1.6
added matrix_minor function to parser both in standard and turbo

Milking more speed out of turbo with v1.1.5

Choose a tag to compare

@gbenroscience gbenroscience released this 26 May 07:25

Full Changelog: v1.1.4...v1.1.5

Completely refactored the runtime variable mapping layer inside ScalarTurboEvaluator1 and ScalarTurboEvaluator2.

  • Runtime Remapping Eliminated: Variable array positions are now baked directly into the MethodHandle topology at compile-time.
    The runtime engine now evaluates expressions by reading straight from the user's input arrays.
  • 30%+ Evaluation Speed Burst: Microbenchmarks show arithmetic evaluation speeds dropping from ~18ns down to ~12.2ns, pulling within arm's reach of raw native Java performance (~6.4ns).
  • Flat Memory Profile: GC allocation churn on hot evaluation paths remains at absolute zero.
    This guarantees stutter-free performance during heavy graph plotting or the soon-coming multi-million step differential equation loops.

Overzealous parser check that disabled nested stats fixed

Choose a tag to compare

@gbenroscience gbenroscience released this 20 May 04:58

Sorry, v1.1.3 tag was not pushed.
This release is targeted at an overzealous check in the parser that disabled the nested stats functionality e.g.
sort(1,2,3,listsum(4,5,9),2,8) should start working again now

Full Changelog: v1.1.2...v1.1.4

MatrixTurboEvaluator support for rot function

Choose a tag to compare

@gbenroscience gbenroscience released this 29 Apr 18:50

What's Changed

  • Returned original readme, and linked from main readme by @judovana in #44
  • Added jdk21+25 to gh workgflows by @judovana in #45
  • Version 1.1.2 fixes bugs and makes MatrixTurboEvaluator natively support turbo execution of the rot function. Note that the ScalarTurboEvaluators already support it.
  • FastCompositeExpression is now aware of its compiler as it now sports a getCompiler default method(which can be overriden to specify the turbo class that compiled it)

Full Changelog: v1.1.1...v1.1.2

Dynamic Version Implemented

Choose a tag to compare

@gbenroscience gbenroscience released this 28 Apr 12:48

Full Changelog: v1.1.0...v1.1.1

Dynamic Version Computation At runtime implemented

Rotor Function and ErrorLog upgrades

Choose a tag to compare

@gbenroscience gbenroscience released this 28 Apr 07:53

Bug fixes in Rotor and ErrorLog. Matrix of Points upgrade for Rotor

  1. The rotor function(rot) has been upgraded to take an argument of a Matrix of Nx3 points to be rotated. It then outputs a Matrix of Nx3 rotated points.
  2. There were bug fixes also in the handling of the rotation of functions. When a function is rotated now, the user is handed the output to solve or make the y(vertical coordinates) the subject of the formula, because the output is generally an implicit function.
  3. Two point function rotation still supported for backwards compatibility.
  4. ErrorLog upgraded

Full Changelog: v1.0.8...v1.1.0

Turbo-Android-Compatibility-Fixes

Choose a tag to compare

@gbenroscience gbenroscience released this 28 Apr 10:48

Full Changelog: v1.0.4...v1.0.8
1.0.8
Bug fixes and more Android compatibility issues resolved.

1.0.6
Bug fixes and Android compatibility issues resolved.

1.0.5
Features bug fixes and optimizations in the scanning/semantic analysis stages.