Skip to content

Question Regarding Relative Performance to the CSPICE Library #1

@Alexander-Da-Great

Description

@Alexander-Da-Great

I was taking a look at these examples: https://github.com/zaynar/rsspice/tree/main/examples. I was curious as to how this rsspice implementation stacked up against CSPICE. Running these standard tests over 2 years and again at 10 years when comparing single threaded rsspice, multi-threaded rsspice, and single threaded cspice executed through a JNI I saw the following:

2 Year Data:

Metric Java (JNI/C) Rust (Single) Rust (Multi-Rayon)
Wall Clock (Total) 2.436s 5.592s 0.928s
CPU Time (User) 2.41s 4.51s 4.70s (note multi)
CPU Utilization 100% 82% 521%

10 Year Data:

Metric Java (JNI/C) Rust (Single) Rust (Multi-Rayon)
Wall Clock (Total) 33.407s 66.29s 10.874s
CPU Time (User) 33.09s 64.22s 73.34s (note multi)
CPU Utilization 99% 98% 678%

The multi-threaded performance constituted a massive improvement of ~3x over single-threaded CSPICE on an M2 Max macbook pro with 64 GB of ram. However, it seems that CSPICE is still ~2x as efficient per cycle as rsspice. I assume this comes down to optimizations specific to CSPICE which begs a question:

Has any thought been paid to converting CSPICE to a rust native project?

I understand this project is an exercise in converting from fortran, however, approaching the single threaded performance of CSPICE even within ~20% while retaining thread-safety would be amazing. From my pov it would eliminate the trade experienced in trying to use this project where small enough tasks do not benefit from multi-threading so sticking with CSPICE along with wrappers to other languages (eg JNI) tends to be the obvious choice. In addition, with enough ram separate processes give parallel performance gains which a slightly faster version of this project would make redundant - eliminating yet another trade and making an extremely useful library.

On the whole very impressed and excited by this project, just thought I would bring up some figures from experimentation and pose a few ideas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions