Skip to content
Permalink
Browse files

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)
  • Loading branch information...
antlarr committed Jun 28, 2018
1 parent 1d7a719 commit 046da19391a32c122569a0b828b43acfe95d57a5
Showing with 3 additions and 1 deletion.
  1. +3 −1 setup.py
@@ -9,7 +9,9 @@
libraries=['boost_python-py3'],
library_dirs=['/usr/lib'],
sources=['bard/bard_ext.cpp'],
extra_compile_args=['-std=gnu++17', '-fopenmp'])
extra_compile_args=['-std=gnu++17', '-fopenmp', '-Ofast',
'-march=native', '-mtune=native',
'-funroll-loops'])

setup(
# Application name:

0 comments on commit 046da19

Please sign in to comment.
You can’t perform that action at this time.