NumJ: Evaluating Fusion, Memory Layout, and Reproducible Reductions in Java–Fortran Numerical Computing
Abstract
This preprint presents NumJ, a Java float64 array library that invokes Fortran kernels through the Foreign Function and Memory API, and analyzes its archived benchmark evidence. The implementation combines strided multidimensional arrays, reusable native buffers, specialized iteration paths, explicit expression fusion, and fixed-order reductions. The evaluation covers addition, axis reductions, a fused multiply–add–square reduction, short rows, allocation, and native threading, with Java, NumPy, NumExpr, and Numba baselines. On the recorded Intel Core i5-13420H system, the contiguous fused expression over 10^7 elements takes 13.36 ms, compared with 46.40 ms for NumPy with reused temporaries and 14.74 ms for the tested Numba loop. For transposed inputs, NumJ instead takes 205.81 ms, versus 86.10 ms for ordinary NumPy. Separate development experiments reduce small contiguous-call overhead from approximately 201 ns to 17 ns. These findings identify workload-dependent opportunities rather than a general language-level advantage. This is a retrospective, single-machine study, not peer reviewed. Limitations include unequal process-repetition protocols across languages and development-stage measurements. The work does not claim full NumPy compatibility or universal performance superiority. No new performance experiment was run during manuscript preparation. AI assistance in repository inspection, literature lookup, analysis organization, and drafting is disclosed in the manuscript. Files: numj-research-paper.pdf (10-page preprint), numj-research-paper.tex (editable LaTeX source), and numj-benchmark-evidence.csv (495 run-specific benchmark summaries). The PDF was rendered separately from the LaTeX source; source compilation has not been verified in this preparation environment. Software and archived evidence: https://github.com/hareramray/numj/tree/8e06299dc6c3dc25b71731d4c549f15e5486201d