Skip to content

Commit 046da19

Browse files
committed
Optimize for the current CPU arch and for speed
Use -Ofast -march=native -mtune=native -funroll-loops to improve the speed without effort :) Before: around 8.5 seconds per iteration (11200 songs/second) After: around 2.9~3 seconds per iteration (30000 songs/second)
1 parent 1d7a719 commit 046da19

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
libraries=['boost_python-py3'],
1010
library_dirs=['/usr/lib'],
1111
sources=['bard/bard_ext.cpp'],
12-
extra_compile_args=['-std=gnu++17', '-fopenmp'])
12+
extra_compile_args=['-std=gnu++17', '-fopenmp', '-Ofast',
13+
'-march=native', '-mtune=native',
14+
'-funroll-loops'])
1315

1416
setup(
1517
# Application name:

0 commit comments

Comments
 (0)