Skip to content

Commit

Permalink
Performance enhancements and bug fixes for Parlay
Browse files Browse the repository at this point in the history
- Added interface for uninitialized relocation. Relocation is an
  optimized operation for swapping an object into uninitialized memory
  and leaving the source uninitialized. In particular, it should provide
  performance improvements for algorithms that frequently move
  non-trivial types, such as sorting a sequence of sequences.
- Added delayed_tabulate primitive, which creates a delayed_sequence
  from the given generator function object without needing to specify
  either the type of the elements or the type of the function object
- Added delayed_map as an alias for dmap.
- Reworked uninitialized memory debugging tests
- Sample sort now has a proper in place version that makes no copies
- Benchmarks now build with -march=native by default
- Sequence factory from_function now always elides the return value
  instead of copying or moving
- Fixed bug in delayed_sequence iterators
- Added lacking unit tests for counting_sort and delayed_sequence, and
  more unit tests for integer_sort and sample_sort
  • Loading branch information
DanielLiamAnderson committed Oct 19, 2020
1 parent f120a22 commit b8d5f3a
Show file tree
Hide file tree
Showing 34 changed files with 2,430 additions and 539 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
# Run the analysis
- mkdir build
- cd build
- CC=clang-10 CXX=clang++-10 cmake -DENABLE_CLANG_TIDY=On ..
- CC=clang-10 CXX=clang++-10 cmake -DENABLE_CLANG_TIDY=On -DCLANG_TIDY_EXE=/usr/bin/clang-tidy ..
- make clang-tidy-all

# Run include-what-you-use on the codebase
Expand Down
1 change: 1 addition & 0 deletions analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ configure_danalysis(
${PARLAY_INCLUDE_DIR}/parlay/sequence.h
${PARLAY_INCLUDE_DIR}/parlay/scheduler.h
${PARLAY_INCLUDE_DIR}/parlay/slice.h
${PARLAY_INCLUDE_DIR}/parlay/type_traits.h
${PARLAY_INCLUDE_DIR}/parlay/utilities.h
IGNORE_DEFINITIONS
PARLAY_CILK
Expand Down
32 changes: 20 additions & 12 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# Benchmarks of example applications (word count, primes, etc.)
add_executable(bench_examples bench_examples.cpp)
target_link_libraries(bench_examples PRIVATE parlay benchmark_main)
target_compile_options(bench_examples PRIVATE -Wall -Wextra -Wfatal-errors)
# Benchmarks for Parlay
#
# Benchmarks are implemented using Google Benchmark.
#
set(NUMA_COMMAND numactl -i all)

# Benchmarks of standard primitives with good performance coverage
add_executable(bench_standard bench_standard.cpp)
target_link_libraries(bench_standard PRIVATE parlay benchmark_main)
target_compile_options(bench_standard PRIVATE -Wall -Wextra -Wfatal-errors)
function(add_benchmark NAME)
add_executable(bench_${NAME} bench_${NAME}.cpp)
target_link_libraries(bench_${NAME} PRIVATE parlay benchmark_main)
target_compile_options(bench_${NAME} PRIVATE -Wall -Wextra -Wfatal-errors -march=native)

# Benchmarks of standard primitives with good performance coverage
add_executable(bench_parsing bench_parsing.cpp)
target_link_libraries(bench_parsing PRIVATE parlay benchmark_main)
target_compile_options(bench_parsing PRIVATE -Wall -Wextra -Wfatal-errors)
if(PARLAY_BENCHMARK_NUMACTL_TARGETS)
add_custom_target(numactl_bench_${NAME}
COMMAND ${NUMA_COMMAND} ${CMAKE_CURRENT_BINARY_DIR}/bench_${NAME} --benchmark_counters_tabular=true
)
add_dependencies(numactl_bench_${NAME} bench_${NAME})
endif()
endfunction()

add_benchmark(examples)
add_benchmark(standard)
add_benchmark(parsing)
Loading

0 comments on commit b8d5f3a

Please sign in to comment.