Skip to content

Commit ace767e

Browse files
authored
Improved performance (#29)
* fix env * fix for debug build * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * update * update images
1 parent da0ac5a commit ace767e

15 files changed

Lines changed: 199 additions & 114 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ input/*
1616
__pycache__/
1717
.ipynb_checkpoints/
1818
.vscode/
19-
.DS_Store
19+
.DS_Store
20+
*.prof

CMakeLists.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ if(WIN32)
55
elseif(APPLE)
66
set(CMAKE_CXX_FLAGS "-O3 -pthread")
77
else()
8+
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-Wall -g -lprofiler -ltcmalloc -DMY_DEBUG")
89
set(CMAKE_CXX_FLAGS "-O3 -pthread")
910
endif()
1011

@@ -20,24 +21,22 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third/cereal/)
2021
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third/snappy/)
2122

2223
pybind11_add_module(PRTree ${MYCPP})
23-
set_target_properties(PRTree PROPERTIES
24-
CXX_STANDARD 17
25-
CXX_STANDARD_REQUIRED TRUE
26-
CXX_EXTENSIONS FALSE
27-
POSITION_INDEPENDENT_CODE ON
28-
C_VISIBILITY_PRESET hidden
29-
CXX_VISIBILITY_PRESET hidden
30-
)
3124
set_target_properties(snappy PROPERTIES
3225
POSITION_INDEPENDENT_CODE ON
3326
C_VISIBILITY_PRESET hidden
3427
CXX_VISIBILITY_PRESET hidden
3528
)
3629

3730
target_link_libraries(PRTree PRIVATE
38-
pybind11::module pybind11::lto pybind11::windows_extras
39-
cereal snappy
31+
cereal
32+
snappy
4033
)
4134

42-
pybind11_extension(PRTree)
43-
pybind11_strip(PRTree)
35+
set_target_properties(PRTree PROPERTIES
36+
CXX_STANDARD 17
37+
CXX_STANDARD_REQUIRED TRUE
38+
CXX_EXTENSIONS FALSE
39+
POSITION_INDEPENDENT_CODE ON
40+
C_VISIBILITY_PRESET hidden
41+
CXX_VISIBILITY_PRESET hidden
42+
)

Dockerfile

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ FROM python:3.10-buster
22

33
ENV PYTHONDONTWRITEBYTECODE 1
44
ENV PYTHONUNBUFFERED 1
5-
ARG USERNAME=user
6-
ARG GROUPNAME=user
7-
ARG UID=1000
8-
ARG GID=1000
95

10-
RUN groupadd -g $GID $GROUPNAME && \
11-
useradd -m -s /bin/bash -u $UID -g $GID $USERNAME
12-
RUN apt-get update && apt-get install -y git openssh-client vim wget curl
13-
14-
USER $USERNAME
15-
ENV PATH $PATH:/home/user/.local/bin
6+
RUN apt-get update && apt-get install -y git openssh-client vim wget curl google-perftools libgoogle-perftools-dev
167
WORKDIR /code

cpp/main.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace py = pybind11;
77

88
using T = int64_t; // is a temporary type of template. You can change it and
99
// recompile this.
10-
const int B = 2; // the number of children of tree.
10+
const int B = 6; // the number of children of tree.
1111

1212
PYBIND11_MODULE(PRTree, m)
1313
{

0 commit comments

Comments
 (0)