From d5411b36b73c849767fb28e6ffc6c878fc73ddba Mon Sep 17 00:00:00 2001 From: PyYoshi Date: Thu, 27 Sep 2018 00:43:10 +0900 Subject: [PATCH] disable LTO because become poor performance --- CHANGES.rst | 2 +- Makefile | 14 ++------------ requirements-dev.txt | 2 ++ setup.py | 10 ++++++++-- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index cff2189..a998307 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ CHANGES 2.1.x ----- -- xxxx +- disable LTO because become poor performance 2.1.3 (2018-09-26) ------------------ diff --git a/Makefile b/Makefile index 0d889b6..d7d8879 100644 --- a/Makefile +++ b/Makefile @@ -19,17 +19,7 @@ install: clean build-manylinux1-wheel: docker pull quay.io/pypa/manylinux1_i686 docker pull quay.io/pypa/manylinux1_x86_64 - docker run --rm -ti -v `pwd`:/project \ - -e CFLAGS="-mtune=generic -pipe -fPIC -flto" \ - -e LDFLAGS="$(LDFLAGS) -flto" \ - -w /project \ - quay.io/pypa/manylinux1_i686 \ - bash dockerfiles/buildwheel.sh - docker run --rm -ti -v `pwd`:/project \ - -e CFLAGS="-mtune=generic -pipe -fPIC -flto" \ - -e LDFLAGS="$(LDFLAGS) -flto" \ - -w /project \ - quay.io/pypa/manylinux1_x86_64 \ - bash dockerfiles/buildwheel.sh + docker run --rm -ti -v `pwd`:/project -w /project quay.io/pypa/manylinux1_i686 bash dockerfiles/buildwheel.sh + docker run --rm -ti -v `pwd`:/project -w /project quay.io/pypa/manylinux1_x86_64 bash dockerfiles/buildwheel.sh build: clean pip test sdist build-manylinux1-wheel diff --git a/requirements-dev.txt b/requirements-dev.txt index b90c5d3..0ad58b2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,3 +3,5 @@ Cython==0.28.5 nose==1.3.7 tox==3.4.0 wheel==0.31.1 +#autopep8==1.4 +#pylint==2.1.1 diff --git a/setup.py b/setup.py index b427eca..04a5b18 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,8 @@ uchardet_dir = 'src/ext/uchardet/src' if have_cython: pyx_sources = glob.glob(cchardet_dir + '*.pyx') sys.stderr.write('cythonize: %r\n' % (pyx_sources,)) - cython_compiler.compile(pyx_sources, options=cython_compiler.CompilationOptions(cplus=True)) + cython_compiler.compile( + pyx_sources, options=cython_compiler.CompilationOptions(cplus=True)) cchardet_sources = glob.glob(cchardet_dir + '*.cpp') sources = cchardet_sources @@ -89,6 +90,8 @@ cfg_vars = sysconfig.get_config_vars() for key, value in cfg_vars.items(): if type(value) == str: cfg_vars[key] = value.replace("-Wstrict-prototypes", "") + # O3を指定したところで速度が向上するかは疑問である + # cfg_vars[key] = value.replace("-O2", "-O3") cchardet_module = Extension( 'cchardet._cchardet', @@ -97,12 +100,15 @@ cchardet_module = Extension( language='c++', ) + def read(f): return open(os.path.join(os.path.dirname(__file__), f)).read().strip() + with codecs.open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'src', 'cchardet', 'version.py'), 'r', 'latin1') as fp: try: - version = re.findall(r"^__version__ = '([^']+)'\r?$", fp.read(), re.M)[0] + version = re.findall( + r"^__version__ = '([^']+)'\r?$", fp.read(), re.M)[0] except IndexError: raise RuntimeError('Unable to determine version.')