Powered by OpenAIRE graph
Found an issue? Give us feedback
image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/ ZENODOarrow_drop_down
image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/
ZENODO
Article . 2025
License: CC BY
Data sources: ZENODO
image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/
ZENODO
Article . 2025
License: CC BY
Data sources: ZENODO
image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/
ZENODO
Article . 2025
License: CC BY
Data sources: ZENODO
image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/
ZENODO
Article . 2025
License: CC BY
Data sources: ZENODO
ZENODO
Article . 2025
License: CC BY
Data sources: Datacite
ZENODO
Article . 2025
License: CC BY
Data sources: Datacite
ZENODO
Article . 2025
License: CC BY
Data sources: Datacite
ZENODO
Article . 2025
License: CC BY
Data sources: Datacite
ZENODO
Article . 2025
License: CC BY
Data sources: Datacite
versions View all 5 versions
addClaim

A Comparative Study of Pure Python and JAX-Based Approaches in Computing Harmonic Series

Authors: Keçeci, Mehmet;

A Comparative Study of Pure Python and JAX-Based Approaches in Computing Harmonic Series

Abstract

A Comparative Study of Pure Python and JAX-Based Approaches in Computing Harmonic Series Mehmet Keçeci ORCID: https://orcid.org/0000-0001-9937-9839, Independent Researcher Received: 29.07.2025 Abstract: This study presents a comparative analysis of a traditional, pure Python-based approach and a modern, JAX library-based approach for calculating the harmonic series, focusing on performance, scalability, and efficiency. The harmonic series is a divergent series of significant importance in mathematical analysis. In computational mathematics, the effective evaluation of such series is critical, particularly in applications requiring large-scale data and high precision. The traditional pure Python approach utilises the fractions.Fraction class to provide exact arithmetic, enhancing the code's readability and accuracy. However, this method exhibits linear time complexity for large values of n, limiting its performance in the context of repetitive calculations. Furthermore, memory usage and processing time increase linearly with n. In contrast, the JAX-based approach (the Oresmej module) leverages the advanced features of JAX, a library designed for high-performance scientific computing, including vectorisation (vmap), just-in-time (JIT) compilation, and automatic differentiation. This approach yields a significant speed advantage, especially in large-scale and repetitive operations. Additionally, caching is supported via @lru_cache, which prevents re-computation for identical inputs. The return value is defined as a tuple, thereby enhancing data integrity and cache compatibility. The comparative analysis was conducted using micro-benchmarking techniques. Following a warm-up period, the JAX-based approach was found to be several hundred times faster than pure Python, with cached functions producing results almost instantaneously. Therefore, for scientific research demanding high performance, scalability, and sustainable computation, approaches based on Cython (Cythonize), Numba, JAX, NumPy, and parallel processing (multiprocessing, joblib) are strongly recommended. Keywords: Harmonic Series, Pure Python, JAX, Scientific Computing, Performance Comparison, Caching, Vectorisation, JIT Compilation, Exact Arithmetic, Sustainable Coding, Green Coding, Yeşil Kodlama, Oresme, Oresmej, Numba, Cython, Cythonize, NumPy, Multiprocessing, joblib, Divergent series.

Keywords

JIT Compilation, Green Coding, Pure Python, Vectorisation, Cythonize, Multiprocessing, Scientific Computing, Caching, Sustainable Coding, Numba, Oresme, Performance Comparison, Yeşil Kodlama, joblib, Exact Arithmetic, Oresmej, NumPy, Harmonic Series, Cython, JAX

  • BIP!
    Impact byBIP!
    selected citations
    These citations are derived from selected sources.
    This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
    0
    popularity
    This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network.
    Average
    influence
    This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
    Average
    impulse
    This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network.
    Average
Powered by OpenAIRE graph
Found an issue? Give us feedback
selected citations
These citations are derived from selected sources.
This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
BIP!Citations provided by BIP!
popularity
This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network.
BIP!Popularity provided by BIP!
influence
This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
BIP!Influence provided by BIP!
impulse
This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network.
BIP!Impulse provided by BIP!
0
Average
Average
Average
Green