Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

從這個庫中獲取最好的性能(Getting the Best Performance from this Library)

到目前為止,在使用這個庫時,所有你能做的就是打開你的編譯器的優化選項。就如下面的表顯示的那樣,在調試模式下使用這個庫的代價(penalty)是相當大的。

比較發行(Release)和調試(Debug)設置下的性能

函數

Microsoft Visual C++ 8.0

Debug Settings: /Od /ZI

Microsoft Visual C++ 8.0

Release settings: /Ox /arch:SSE2

erf

16.65

(1.028e-006s)

1.00

(6.173e-008s)

erf_inv

19.28

(1.215e-006s)

1.00

(6.302e-008s)

ibetaibetac

8.32

(1.540e-005s)

1.00

(1.852e-006s)

ibeta_invibetac_inv

10.25

(7.492e-005s)

1.00

(7.311e-006s)

ibeta_inva, ibetac_inva, ibeta_invbibetac_invb

8.57

(2.441e-004s)

1.00

(2.847e-005s)

gamma_pgamma_q

10.98

(1.044e-005s)

1.00

(9.504e-007s)

gamma_p_invgamma_q_inv

10.25

(3.721e-005s)

1.00

(3.631e-006s)

gamma_p_invagamma_q_inva

11.26

(1.124e-004s)

1.00

(9.982e-006s)



PrevUpHomeNext