hayden4r4 / blackscholes-rust

A Black-Scholes pricing model built in Rust
MIT License
8 stars 6 forks source link

Performance Analysis of erf custom algo #6

Closed day01 closed 1 week ago

day01 commented 1 week ago

Performance Analysis:

The performance tests conducted in erf_cody_test.cpp compare the execution time of our custom erf_cody function with the standard library's erf function. The results consistently show that erf outperforms erf_cody. In the performance test summary, erf won in 3501 cases, while erf_cody won in 2735 cases. Additionally, the total execution time for erf was 261666 nanoseconds, while it was 293012 nanoseconds for erf_cody. This suggests that the standard library's erf function is more efficient than our custom implementation. Given these results, I recommend that we transition to using the standard library's erf function for future development. This will not only improve the performance of our code but also reduce the maintenance overhead of our custom implementation.

test prepare: ./erf_cody_test

result: Unit Test Summary: 5/5 tests passed. Performance Test Summary: Cody wins: 2735, Std wins: 3501 Total execution time (Cody): 293012 nanoseconds, (Std): 261666 nanoseconds

day01 commented 1 week ago

@hayden4r4 if you accept direction I will continue with next commit :)

day01 commented 1 week ago

Refactor was fast so, https://github.com/hayden4r4/blackscholes-rust/pull/7 @hayden4r4 if you agree :)