chore(3p/immer): Remove vendored copy of immer

We ended up dropping the use of this library again.

Change-Id: I2c44cd22a6128d23f87a582402bf5fb84991d608
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2292
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
This commit is contained in:
Vincent Ambo 2020-12-23 13:36:55 +01:00 committed by tazjin
parent f7ea650142
commit 73e9265f95
311 changed files with 0 additions and 74218 deletions

View file

@ -1,38 +0,0 @@
---
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'true'
AlignEscapedNewlines: Right
AlignTrailingComments: 'true'
AllowShortFunctionsOnASingleLine: 'true'
AllowShortBlocksOnASingleLine: 'true'
AlwaysBreakTemplateDeclarations: 'true'
AccessModifierOffset: -4
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBraces: Mozilla
BreakBeforeInheritanceComma: 'true'
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: BeforeComma
BreakStringLiterals: 'true'
ColumnLimit: '80'
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'false'
FixNamespaceComments: 'true'
IndentCaseLabels: 'false'
IndentWidth: '4'
IndentWrappedFunctionNames: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Language: Cpp
MaxEmptyLinesToKeep: '1'
NamespaceIndentation: None
PointerAlignment: Left
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'true'
SpaceAfterTemplateKeyword: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: ControlStatements
TabWidth: '4'
UseTab: Never
...

View file

@ -1,7 +0,0 @@
((nil .
((indent-tabs-mode . nil)
(show-trailing-whitespace . t)))
(c-mode .
((mode . c++)))
(c++-mode .
((eval add-hook 'before-save-hook #'clang-format-buffer nil t))))

View file

@ -1,3 +0,0 @@
github: arximboldi
patreon: sinusoidal
custom: ["paypal.me/sinusoidal", sinusoid.al]

View file

@ -1,24 +0,0 @@
bazel-*
build/
build-*/
reports/
doc/_build
doc/_doxygen
bazel-*
tools/travis/ssh-key
tools/clojure/target/
tools/scala/target/
tools/scala/project/target/
extra/js/out
extra/js/boost
__pycache__
.gdb_history
.cache
tools/clojure/.lein*
*.pyc

View file

@ -1 +0,0 @@
Third-party code with non-depot layout.

View file

@ -1,84 +0,0 @@
language: nix
dist: trusty
git:
depth: false
matrix:
include:
- env: DO=check TYPE=Debug TOOLCHAIN=llvm-5 SANITIZE=true
- env: DO=check TYPE=Release TOOLCHAIN=llvm-5 BENCHMARKS=true
- env: DO=check TYPE=Debug TOOLCHAIN=gnu-6 COVERAGE=true
- env: DO=check TYPE=Release TOOLCHAIN=gnu-6 BENCHMARKS=true
- env: DO=check TYPE=Debug TOOLCHAIN=gnu-7 STD=17
- env: DO=check TYPE=Debug TOOLCHAIN=llvm-9 STD=17 FUZZERS=true
- env: DO=build
- env: DO=docs
before_install:
- |
: ${TOOLCHAIN:=gnu-6}
: ${TYPE:=Debug}
: ${STD:=14}
function build-p { [[ "${DO}" == build ]]; }
function check-p { [[ "${DO}" == check ]]; }
function docs-p { [[ "${DO}" == docs ]]; }
function coverage-p { [[ "${COVERAGE}" == true ]]; }
function benchmarks-p { [[ "${BENCHMARKS}" == true ]]; }
function deploy-p {
[[ "${TRAVIS_PULL_REQUEST}" == "false" && \
"${TRAVIS_BRANCH}" == "master" ]]
}
function upload-p {
[[ -n "$encrypted_1c8d51d72e41_key" && \
-n "$encrypted_1c8d51d72e41_iv" ]]
}
function decrypt-ssh-key {
openssl aes-256-cbc \
-K $encrypted_1c8d51d72e41_key \
-iv $encrypted_1c8d51d72e41_iv \
-in tools/travis/ssh-key.enc \
-out tools/travis/ssh-key -d
chmod 600 tools/travis/ssh-key
}
function with-nix {
nix-shell --argstr toolchain $TOOLCHAIN --run "set -e; $1"
}
install:
- with-nix "echo == nix environment ok"
before_script:
- |
with-nix "
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${TYPE} \
-DCHECK_SLOW_TESTS=false \
-DCXX_STANDARD=${STD} \
-DCHECK_BENCHMARKS=${BENCHMARKS} \
-DENABLE_COVERAGE=${COVERAGE} \
-DENABLE_SANITIZE=${SANITIZE} \
-DCHECK_FUZZERS=${FUZZERS} \
-DDISABLE_FREE_LIST=${SANITIZE}
"
script:
- |
set -e
! build-p || nix-build
! check-p || with-nix "cd build && make -j2 check"
! docs-p || with-nix "cd build && make docs"
after_success:
- |
! coverage-p || with-nix "
cd build
find . -name \"*.gcno\" | xargs gcov -bcprs ${PWD}
bash <(curl -s https://codecov.io/bash) -x gcov
"
if upload-p; then
decrypt-ssh-key
! benchmarks-p || with-nix "cd build && make upload-benchmark-reports"
! docs-p || ! deploy-p || with-nix "cd build && make upload-docs"
fi

View file

@ -1,11 +0,0 @@
package(default_visibility = ["//visibility:public"])
cc_library(
name = "immer",
include_prefix = "immer",
strip_include_prefix =
"immer",
hdrs = glob([
"immer/**/*.hpp",
]),
)

View file

@ -1,141 +0,0 @@
cmake_minimum_required(VERSION 3.5.1)
cmake_policy(SET CMP0048 NEW) # enable project VERSION
cmake_policy(SET CMP0056 NEW) # honor link flags in try_compile()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project(immer VERSION 0.6.2)
if (NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-extended-offsetof -Wno-c++17-extensions -Wno-c++1z-extensions -Wno-unknown-warning-option")
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
set(CMAKE_CXX_EXTENSIONS off)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments")
endif()
include(GNUInstallDirs)
include(ImmerUtils)
# Options
# =======
option(ENABLE_SANITIZE "compile with sanitizers enabled")
option(ENABLE_COVERAGE "compile with test coverage support")
option(DISABLE_WERROR "enable --werror")
option(DISABLE_FREE_LIST "disables the free list heap")
option(DISABLE_THREAD_SAFETY "disables thread safety by default")
option(CHECK_FUZZERS "Add fuzzers as part of make check")
option(ENABLE_PYTHON "enable building python module" off)
option(ENABLE_GUILE "enable building guile module" off)
option(ENABLE_BOOST_COROUTINE "run benchmarks with boost coroutine" off)
option(immer_BUILD_TESTS "Build tests" ON)
option(immer_BUILD_EXAMPLES "Build examples" ON)
option(immer_BUILD_DOCS "Build docs" ON)
option(immer_BUILD_EXTRAS "Build extras" ON)
set(CXX_STANDARD 14 CACHE STRING "c++ standard number")
set(CMAKE_CXX_STANDARD ${CXX_STANDARD})
set(CMAKE_CXX_STANDARD_REQUIRED on)
if (ENABLE_SANITIZE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak")
endif()
if (NOT MSVC AND NOT DISABLE_WERROR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif()
# Dependencies
# ============
if (ENABLE_BOOST_COROUTINE)
set(immer_boost_components coroutine)
endif()
find_package(Threads)
find_package(BoehmGC)
find_package(Boost 1.56 COMPONENTS ${immer_boost_components})
find_program(CCACHE ccache)
if (CCACHE)
message(STATUS "Using ccache: ${CCACHE}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
else()
message(STATUS "Could not find ccache")
endif()
if (NOT BOEHM_GC_FOUND)
set(BOEHM_GC_LIBRARIES "")
endif()
# Targets
# =======
# the library
add_library(immer INTERFACE)
target_include_directories(immer INTERFACE
$<BUILD_INTERFACE:${immer_BINARY_DIR}/>
$<BUILD_INTERFACE:${immer_SOURCE_DIR}/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
install(TARGETS immer EXPORT ImmerConfig)
install(EXPORT ImmerConfig DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Immer")
install(DIRECTORY immer DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
# development target to be used in tests, examples, benchmarks...
immer_canonicalize_cmake_booleans(
DISABLE_FREE_LIST
DISABLE_THREAD_SAFETY
CHECK_SLOW_TESTS)
add_library(immer-dev INTERFACE)
target_include_directories(immer-dev SYSTEM INTERFACE
${Boost_INCLUDE_DIR}
${BOEHM_GC_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/tools/include)
target_link_libraries(immer-dev INTERFACE
immer
${BOEHM_GC_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
target_compile_definitions(immer-dev INTERFACE
-DIMMER_CXX_STANDARD=${CXX_STANDARD}
-DIMMER_HAS_LIBGC=1
-DIMMER_NO_FREE_LIST=${DISABLE_FREE_LIST}
-DIMMER_NO_THREAD_SAFETY=${DISABLE_THREAD_SAFETY}
-DIMMER_SLOW_TESTS=${CHECK_SLOW_TESTS})
if (ENABLE_COVERAGE)
target_compile_options(immer-dev INTERFACE "--coverage")
target_link_libraries(immer-dev INTERFACE "--coverage")
endif()
# Testing
# =======
if (immer_BUILD_TESTS)
enable_testing()
add_custom_target(check
COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Build and run all the tests and examples.")
add_subdirectory(test)
add_subdirectory(benchmark)
endif()
if (immer_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
if (immer_BUILD_DOCS)
add_subdirectory(doc)
endif()
if (immer_BUILD_EXTRAS)
add_subdirectory(extra/fuzzer)
add_subdirectory(extra/python)
add_subdirectory(extra/guile)
endif()

View file

@ -1,23 +0,0 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View file

@ -1,225 +0,0 @@
.. image:: https://travis-ci.org/arximboldi/immer.svg?branch=master
:target: https://travis-ci.org/arximboldi/immer
:alt: Travis Badge
.. image:: https://codecov.io/gh/arximboldi/immer/branch/master/graph/badge.svg
:target: https://codecov.io/gh/arximboldi/immer
:alt: CodeCov Badge
.. image:: https://cdn.rawgit.com/arximboldi/immer/355a113782aedc2ea22463444014809269c2376d/doc/_static/sinusoidal-badge.svg
:target: https://sinusoid.al
:alt: Sinusoidal Engineering badge
:align: right
.. raw:: html
<img width="100%" src="https://cdn.rawgit.com/arximboldi/immer/3888170d247359cc0905eed548cd46897caef0f4/doc/_static/logo-front.svg" alt="Logotype"/>
.. include:introduction/start
**immer** is a library of persistent_ and immutable_ data structures
written in C++. These enable whole new kinds of architectures for
interactive and concurrent programs of striking simplicity,
correctness, and performance.
.. _persistent: https://en.wikipedia.org/wiki/Persistent_data_structure
.. _immutable: https://en.wikipedia.org/wiki/Immutable_object
* **Documentation** (Contents_)
* **Code** (GitHub_)
* **CppCon'17 Talk**: *Postmodern Immutable Data Structures* (YouTube_, Slides_)
* **ICFP'17 Paper**: *Persistence for the masses* (Preprint_)
.. _contents: https://sinusoid.es/immer/#contents
.. _github: https://github.com/arximboldi/immer
.. _youtube: https://www.youtube.com/watch?v=sPhpelUfu8Q
.. _slides: https://sinusoid.es/talks/immer-cppcon17
.. _preprint: https://public.sinusoid.es/misc/immer/immer-icfp17.pdf
.. raw:: html
<a href="https://www.patreon.com/sinusoidal">
<img align="right" src="https://cdn.rawgit.com/arximboldi/immer/master/doc/_static/patreon.svg">
</a>
This library has full months of *pro bono* research and development
invested in it. This is just the first step in a long-term vision
of making interactive and concurrent C++ programs easier to
write. **Put your logo here and help this project's long term
sustainability by buying a sponsorship package:** immer@sinusoid.al
.. include:index/end
Example
-------
.. github does not support the ``literalinclude`` directive. This
example is copy pasted from ``example/vector/intro.cpp``
.. code-block:: c++
#include <immer/vector.hpp>
int main()
{
const auto v0 = immer::vector<int>{};
const auto v1 = v0.push_back(13);
assert(v0.size() == 0 && v1.size() == 1 && v1[0] == 13);
const auto v2 = v1.set(0, 42);
assert(v1[0] == 13 && v2[0] == 42);
}
..
For a **complete example** check `Ewig, a simple didactic
text-editor <https://github.com/arximboldi/ewig>`_ built with this
library. You may also wanna check `Lager, a Redux-like library
<https://github.com/arximboldi/lager>`_ for writting interactive
software in C++ using a value-oriented design.
Why?
----
In the last few years, there has been a growing interest in immutable
data structures, motivated by the horizontal scaling of our processing
power and the ubiquity of highly interactive systems. Languages like
Clojure_ and Scala_ provide them by default, and implementations
for JavaScript like Mori_ and Immutable.js_ are widely used,
specially in combination with modern UI frameworks like React_.
Interactivity
Thanks to *persistence* and *structural sharing*, new values can
be efficiently compared with old ones. This enables simpler ways of
*reasoning about change* that sit at the core of modern
interactive systems programming paradigms like `reactive
programming`_.
Concurrency
Passing immutable data structures by value does not need to copy
any data. In the absence of mutation, data can be safely read
from multiple concurrent processes, and enable concurrency
patterns like `share by communicating`_ efficiently.
Parallelism
Some recent immutable data structures have interesting properties
like :math:`O(log(n))` concatenation, which enable new kinds of
`parallelization algorithms`_.
.. _clojure: http://clojure.org/reference/data_structures
.. _scala: http://docs.scala-lang.org/overviews/collections/overview.html
.. _mori: https://swannodette.github.io/mori/
.. _immutable.js: https://github.com/facebook/immutable-js
.. _react: https://facebook.github.io/react/
.. _reactive programming: https://en.wikipedia.org/wiki/Reactive_programming
.. _share by communicating: https://blog.golang.org/share-memory-by-communicating
.. _parallelization algorithms: http://docs.scala-lang.org/overviews/parallel-collections/overview.html
Features
--------
Idiomatic
This library doesn't pretend that it is written in Haskell. It
leverages features from recent standards to provide an API that is
both efficient and natural for a C++ developer.
Performant
You use C++ because you need this. *Immer* implements state of
the art data structures with efficient cache utilization and have
been proven production ready in other languages. It also includes
our own improvements over that are only possible because of the
C++'s ability to abstract over memory layout. We monitor the
performance impact of every change by collecting `benchmark
results`_ directly from CI.
.. _benchmark results: https://public.sinusoid.es/misc/immer/reports/
Customizable
We leverage templates and `policy-based design`_ to build
data-structures that can be adapted to work efficiently for
various purposes and architectures, for example, by choosing among
various `memory management strategies`. This turns
*immer* into a good foundation to provide immutable data
structures to higher level languages with a C runtime, like
Python_ or Guile_.
.. _python: https://www.python.org/
.. _guile: https://www.gnu.org/software/guile/
.. _policy-based design: https://en.wikipedia.org/wiki/Policy-based_design
.. _memory management strategies: https://sinusoid.es/immer/memory.html
Dependencies
------------
This library is written in **C++14** and a compliant compiler is
necessary. It is `continuously tested`_ with Clang 3.8 and GCC 6, but
it might work with other compilers and versions.
No external library is necessary and there are no other requirements.
.. _continuously tested: https://travis-ci.org/arximboldi/immer
Usage
-----
This is a **header only** library. You can just copy the ``immer``
subfolder somewhere in your *include path*.
If you are using the `Nix package manager`_ (we strongly recommend it)
you can just::
nix-env -if https://github.com/arximboldi/immer/archive/master.tar.gz
Alternatively, you can use `CMake`_ to install the library in your
system once you have manually cloned the repository::
mkdir -p build && cd build
cmake .. && sudo make install
.. _nix package manager: https://nixos.org/nix
.. _cmake: https://cmake.org/
Development
-----------
In order to develop the library, you will need to compile and run the
examples, tests and benchmarks. These require some additional tools.
The easiest way to install them is by using the `Nix package
manager`_. At the root of the repository just type::
nix-shell
This will download all required dependencies and create an isolated
environment in which you can use these dependencies, without polluting
your system.
Then you can proceed to generate a development project using `CMake`_::
mkdir build && cd build
cmake ..
From then on, one may build and run all tests by doing::
make check
In order to build and run all benchmarks when running ``make check``,
run ``cmake`` again with the option ``-DCHECK_BENCHMARKS=1``. The
results of running the benchmarks will be saved to a folder
``reports/`` in the project root.
License
-------
**This software is licensed under the Boost Software License 1.0**.
.. image:: https://upload.wikimedia.org/wikipedia/commons/c/cd/Boost.png
:alt: Boost logo
:target: http://boost.org/LICENSE_1_0.txt
:align: right
The full text of the license is can be accessed `via this link
<http://boost.org/LICENSE_1_0.txt>`_ and is also included
in the ``LICENSE`` file of this software package.

View file

View file

@ -1,128 +0,0 @@
# Config
# ======
option(CHECK_BENCHMARKS "Run benchmarks on check target" off)
option(BENCHMARK_DISABLE_GC "Disable gc during a measurement")
set(BENCHMARK_PARAM "N:1000" CACHE STRING "Benchmark parameters")
set(BENCHMARK_SAMPLES "20" CACHE STRING "Benchmark samples")
# Dependencies
# ============
find_package(RRB)
if (NOT RRB_FOUND)
message(STATUS "Disabling benchmarks")
return()
endif()
# These are expected to be in the include path, the nix-shell
# environment installs them:
#
# https://github.com/marcusz/steady
# https://github.com/deepsea-inria/chunkedseq.git
# https://github.com/rsms/immutable-cpp.git
# Targets
# =======
add_custom_target(benchmarks
COMMENT "Build all benchmarks.")
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE immer_git_commit_hash
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND git status --porcelain
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE immer_git_status
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT immer_git_status STREQUAL "")
set(immer_git_commit_hash "${immer_git_commit_hash}+")
endif()
site_name(immer_hostname)
get_filename_component(immer_compiler_name "${CMAKE_CXX_COMPILER}" NAME)
set(immer_benchmark_report_base_dir "${CMAKE_SOURCE_DIR}/reports")
set(immer_benchmark_report_dir "${immer_benchmark_report_base_dir}/report_\
${immer_git_commit_hash}_\
${immer_hostname}_\
${immer_compiler_name}_\
${BENCHMARK_PARAM}_\
s${BENCHMARK_SAMPLES}")
if(DISABLE_FREE_LIST)
set(immer_benchmark_report_dir "${immer_benchmark_report_dir}_nofl")
endif()
if(DISABLE_THREAD_SAFETY)
set(immer_benchmark_report_dir "${immer_benchmark_report_dir}_nots")
endif()
if(BENCHMARK_DISABLE_GC)
set(immer_benchmark_report_dir "${immer_benchmark_report_dir}_nogc")
endif()
if(CHECK_BENCHMARKS)
add_dependencies(check benchmarks)
endif()
add_custom_target(benchmark-report-dir
COMMAND ${CMAKE_COMMAND}
-E make_directory ${immer_benchmark_report_dir})
file(GLOB_RECURSE immer_benchmarks "*.cpp")
foreach(_file IN LISTS immer_benchmarks)
immer_target_name_for(_target _output "${_file}")
add_executable(${_target} EXCLUDE_FROM_ALL "${_file}")
set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${_output})
add_dependencies(benchmarks ${_target})
add_dependencies(${_target} benchmark-report-dir)
target_compile_options(${_target} PUBLIC -Wno-unused-function)
target_compile_definitions(${_target} PUBLIC
NONIUS_RUNNER
IMMER_BENCHMARK_LIBRRB=1
IMMER_BENCHMARK_STEADY=1
IMMER_BENCHMARK_EXPERIMENTAL=0
IMMER_BENCHMARK_DISABLE_GC=${BENCHMARK_DISABLE_GC}
IMMER_BENCHMARK_BOOST_COROUTINE=${ENABLE_BOOST_COROUTINE})
target_link_libraries(${_target} PUBLIC
immer-dev
${RRB_LIBRARIES})
target_include_directories(${_target} SYSTEM PUBLIC
${RRB_INCLUDE_DIR})
if(CHECK_BENCHMARKS)
add_test("benchmark/${_output}" "${CMAKE_SOURCE_DIR}/tools/with-tee.bash"
${immer_benchmark_report_dir}/${_target}.out
"${CMAKE_CURRENT_BINARY_DIR}/${_output}" -v
-t ${_target}
-r html
-s ${BENCHMARK_SAMPLES}
-p ${BENCHMARK_PARAM}
-o ${immer_benchmark_report_dir}/${_target}.html)
endif()
endforeach()
set(immer_ssh_method
ssh -p 5488
-o StrictHostKeyChecking=no
-i ${CMAKE_SOURCE_DIR}/tools/travis/ssh-key)
add_custom_target(upload-benchmark-reports
COMMAND
rsync -av -e \"${immer_ssh_method}\"
${immer_benchmark_report_base_dir}
raskolnikov@sinusoid.es:public/misc/immer/)
add_custom_target(copy-benchmark-reports
COMMAND
rsync -av ${immer_benchmark_report_base_dir}
~/public/misc/immer/)

View file

@ -1,55 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include <nonius.h++>
#include <immer/heap/gc_heap.hpp>
#include <immer/memory_policy.hpp>
namespace {
NONIUS_PARAM(N, std::size_t{1000})
struct gc_disable
{
gc_disable()
{
#if IMMER_BENCHMARK_DISABLE_GC
GC_disable();
#else
GC_gcollect();
#endif
}
~gc_disable()
{
#if IMMER_BENCHMARK_DISABLE_GC
GC_enable();
GC_gcollect();
#endif
}
gc_disable(const gc_disable&) = delete;
gc_disable(gc_disable&&) = delete;
};
template <typename Meter, typename Fn>
void measure(Meter& m, Fn&& fn)
{
gc_disable guard;
return m.measure(std::forward<Fn>(fn));
}
using def_memory = immer::default_memory_policy;
using gc_memory = immer::memory_policy<immer::heap_policy<immer::gc_heap>, immer::no_refcount_policy>;
using gcf_memory = immer::memory_policy<immer::heap_policy<immer::gc_heap>, immer::no_refcount_policy, immer::gc_transience_policy, false>;
using basic_memory = immer::memory_policy<immer::heap_policy<immer::cpp_heap>, immer::refcount_policy>;
using safe_memory = immer::memory_policy<immer::free_list_heap_policy<immer::cpp_heap>, immer::refcount_policy>;
using unsafe_memory = immer::memory_policy<immer::unsafe_free_list_heap_policy<immer::cpp_heap>, immer::unsafe_refcount_policy>;
} // anonymous namespace

View file

@ -1,146 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include <immer/detail/ref_count_base.hpp>
#include <nonius.h++>
#include <boost/intrusive_ptr.hpp>
#include <atomic>
#include <cstdlib>
#include <iterator>
#include <memory>
#include <utility>
#include <array>
#include <vector>
NONIUS_PARAM(N, std::size_t{1000})
constexpr auto benchmark_size = 32u;
struct object_t : immer::detail::ref_count_base<object_t>
{};
auto make_data()
{
auto objs = std::array<std::unique_ptr<object_t>, benchmark_size>();
std::generate(objs.begin(), objs.end(), [] {
return std::make_unique<object_t>();
});
auto refs = std::array<object_t*, benchmark_size>();
std::transform(objs.begin(), objs.end(), refs.begin(), [](auto& obj) {
return obj.get();
});
return make_pair(std::move(objs),
std::move(refs));
}
NONIUS_BENCHMARK("intrusive_ptr", [] (nonius::chronometer meter)
{
auto arr = std::array<boost::intrusive_ptr<object_t>, benchmark_size>{};
auto storage = std::vector<
nonius::storage_for<
std::array<boost::intrusive_ptr<object_t>, benchmark_size>>> (
meter.runs());
std::generate(arr.begin(), arr.end(), [] {
return new object_t{};
});
meter.measure([&] (int i) {
storage[i].construct(arr);
});
})
NONIUS_BENCHMARK("generic", [] (nonius::chronometer meter)
{
auto data = make_data();
auto& refs = data.second;
object_t* r[benchmark_size];
meter.measure([&] {
std::transform(refs.begin(), refs.end(), r, [] (auto& p) {
if (p) p->ref_count.fetch_add(1, std::memory_order_relaxed);
return p;
});
return r;
});
})
NONIUS_BENCHMARK("manual", [] (nonius::chronometer meter)
{
auto data = make_data();
auto& refs = data.second;
object_t* r[benchmark_size];
meter.measure([&] {
for (auto& p : refs)
if (p) p->ref_count.fetch_add(1, std::memory_order_relaxed);
std::copy(refs.begin(), refs.end(), r);
return r;
});
})
NONIUS_BENCHMARK("manual - unroll", [] (nonius::chronometer meter)
{
auto data = make_data();
auto& refs = data.second;
object_t* r[benchmark_size];
meter.measure([&] {
auto e = refs.end();
for (auto p = refs.begin(); p != e;) {
(*p++)->ref_count.fetch_add(1, std::memory_order_relaxed);
(*p++)->ref_count.fetch_add(1, std::memory_order_relaxed);
(*p++)->ref_count.fetch_add(1, std::memory_order_relaxed);
(*p++)->ref_count.fetch_add(1, std::memory_order_relaxed);
}
std::copy(refs.begin(), refs.end(), r);
return r;
});
})
NONIUS_BENCHMARK("manual - nocheck", [] (nonius::chronometer meter)
{
auto data = make_data();
auto& refs = data.second;
object_t* r[benchmark_size];
meter.measure([&] {
for (auto& p : refs)
p->ref_count.fetch_add(1, std::memory_order_relaxed);
std::copy(refs.begin(), refs.end(), r);
return r;
});
})
NONIUS_BENCHMARK("manual - constant", [] (nonius::chronometer meter)
{
auto data = make_data();
auto& refs = data.second;
object_t* r[benchmark_size];
meter.measure([&] {
for (auto i = 0u; i < benchmark_size; ++i)
refs[i]->ref_count.fetch_add(1, std::memory_order_relaxed);
std::copy(refs.begin(), refs.end(), r);
return r;
});
})
NONIUS_BENCHMARK("manual - memcopy", [] (nonius::chronometer meter)
{
auto data = make_data();
auto& refs = data.second;
object_t* r[benchmark_size];
meter.measure([&] {
for (auto& p : refs)
if (p) p->ref_count.fetch_add(1, std::memory_order_relaxed);
std::memcpy(r, &refs[0], sizeof(object_t*) * benchmark_size);
return r;
});
})

View file

@ -1,175 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include "benchmark/config.hpp"
#include <immer/set.hpp>
#include <hash_trie.hpp> // Phil Nash
#include <boost/container/flat_set.hpp>
#include <set>
#include <unordered_set>
namespace {
template <typename T=unsigned>
auto make_generator_ranged(std::size_t runs)
{
assert(runs > 0);
auto engine = std::default_random_engine{13};
auto dist = std::uniform_int_distribution<T>{0, (T)runs-1};
auto r = std::vector<T>(runs);
std::generate_n(r.begin(), runs, std::bind(dist, engine));
return r;
}
template <typename Generator, typename Set>
auto benchmark_access_std()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g1 = Generator{}(n);
auto g2 = make_generator_ranged(n);
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v.insert(g1[i]);
measure(meter, [&] {
auto c = 0u;
for (auto i = 0u; i < n; ++i)
c += v.count(g1[g2[i]]);
volatile auto r = c;
return r;
});
};
}
template <typename Generator, typename Set>
auto benchmark_access_hamt()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g1 = Generator{}(n);
auto g2 = make_generator_ranged(n);
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v.insert(g1[i]);
measure(meter, [&] {
auto c = 0u;
for (auto i = 0u; i < n; ++i) {
auto& x = g1[g2[i]];
auto leaf = v.find(x).leaf();
c += !!(leaf && leaf->find(x));
}
volatile auto r = c;
return r;
});
};
}
template <typename Generator, typename Set>
auto benchmark_access()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g1 = Generator{}(n);
auto g2 = make_generator_ranged(n);
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v = v.insert(g1[i]);
measure(meter, [&] {
auto c = 0u;
for (auto i = 0u; i < n; ++i)
c += v.count(g1[g2[i]]);
volatile auto r = c;
return r;
});
};
}
template <typename Generator, typename Set>
auto benchmark_bad_access_std()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g1 = Generator{}(n*2);
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v.insert(g1[i]);
measure(meter, [&] {
auto c = 0u;
for (auto i = 0u; i < n; ++i)
c += v.count(g1[n+i]);
volatile auto r = c;
return r;
});
};
}
template <typename Generator, typename Set>
auto benchmark_bad_access_hamt()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g1 = Generator{}(n*2);
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v.insert(g1[i]);
measure(meter, [&] {
auto c = 0u;
for (auto i = 0u; i < n; ++i) {
auto& x = g1[n+i];
auto leaf = v.find(x).leaf();
c += !!(leaf && leaf->find(x));
}
volatile auto r = c;
return r;
});
};
}
template <typename Generator, typename Set>
auto benchmark_bad_access()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g1 = Generator{}(n*2);
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v = v.insert(g1[i]);
measure(meter, [&] {
auto c = 0u;
for (auto i = 0u; i < n; ++i)
c += v.count(g1[n+i]);
volatile auto r = c;
return r;
});
};
}
} // namespace

View file

@ -1,30 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "access.hpp"
#ifndef GENERATOR_T
#error "you must define a GENERATOR_T"
#endif
using generator__ = GENERATOR_T;
using t__ = typename decltype(generator__{}(0))::value_type;
NONIUS_BENCHMARK("std::set", benchmark_access_std<generator__, std::set<t__>>())
NONIUS_BENCHMARK("std::unordered_set", benchmark_access_std<generator__, std::unordered_set<t__>>())
NONIUS_BENCHMARK("boost::flat_set", benchmark_access_std<generator__, boost::container::flat_set<t__>>())
NONIUS_BENCHMARK("hamt::hash_trie", benchmark_access_hamt<generator__, hamt::hash_trie<t__>>())
NONIUS_BENCHMARK("immer::set/5B", benchmark_access<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,def_memory,5>>())
NONIUS_BENCHMARK("immer::set/4B", benchmark_access<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,def_memory,4>>())
NONIUS_BENCHMARK("bad/std::set", benchmark_bad_access_std<generator__, std::set<t__>>())
NONIUS_BENCHMARK("bad/std::unordered_set", benchmark_bad_access_std<generator__, std::unordered_set<t__>>())
NONIUS_BENCHMARK("bad/boost::flat_set", benchmark_bad_access_std<generator__, boost::container::flat_set<t__>>())
NONIUS_BENCHMARK("bad/hamt::hash_trie", benchmark_bad_access_hamt<generator__, hamt::hash_trie<t__>>())
NONIUS_BENCHMARK("bad/immer::set/5B", benchmark_bad_access<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,def_memory,5>>())
NONIUS_BENCHMARK("bad/immer::set/4B", benchmark_bad_access<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,def_memory,4>>())

View file

@ -1,55 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include "benchmark/config.hpp"
#include <immer/set.hpp>
#include <hash_trie.hpp> // Phil Nash
#include <boost/container/flat_set.hpp>
#include <set>
#include <unordered_set>
namespace {
template <typename Generator, typename Set>
auto benchmark_insert_mut_std()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g = Generator{}(n);
measure(meter, [&] {
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v.insert(g[i]);
return v;
});
};
}
template <typename Generator, typename Set>
auto benchmark_insert()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g = Generator{}(n);
measure(meter, [&] {
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v = v.insert(g[i]);
return v;
});
};
}
} // namespace

View file

@ -1,28 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "insert.hpp"
#ifndef GENERATOR_T
#error "you must define a GENERATOR_T"
#endif
using generator__ = GENERATOR_T;
using t__ = typename decltype(generator__{}(0))::value_type;
NONIUS_BENCHMARK("std::set", benchmark_insert_mut_std<generator__, std::set<t__>>())
NONIUS_BENCHMARK("std::unordered_set", benchmark_insert_mut_std<generator__, std::unordered_set<t__>>())
NONIUS_BENCHMARK("boost::flat_set", benchmark_insert_mut_std<generator__, boost::container::flat_set<t__>>())
NONIUS_BENCHMARK("hamt::hash_trie", benchmark_insert_mut_std<generator__, hamt::hash_trie<t__>>())
NONIUS_BENCHMARK("immer::set/5B", benchmark_insert<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,def_memory,5>>())
NONIUS_BENCHMARK("immer::set/4B", benchmark_insert<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,def_memory,4>>())
#ifndef DISABLE_GC_BENCHMARKS
NONIUS_BENCHMARK("immer::set/GC", benchmark_insert<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,gc_memory,5>>())
#endif
NONIUS_BENCHMARK("immer::set/UN", benchmark_insert<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,unsafe_memory,5>>())

View file

@ -1,111 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include "benchmark/config.hpp"
#include <immer/set.hpp>
#include <immer/box.hpp>
#include <immer/algorithm.hpp>
#include <hash_trie.hpp> // Phil Nash
#include <boost/container/flat_set.hpp>
#include <set>
#include <unordered_set>
#include <numeric>
namespace {
template <typename T>
struct iter_step
{
unsigned operator() (unsigned x, const T& y) const
{
return x + y;
}
};
template <>
struct iter_step<std::string>
{
unsigned operator() (unsigned x, const std::string& y) const
{
return x + (unsigned) y.size();
}
};
template <>
struct iter_step<immer::box<std::string>>
{
unsigned operator() (unsigned x, const immer::box<std::string>& y) const
{
return x + (unsigned) y->size();
}
};
template <typename Generator, typename Set>
auto benchmark_access_std_iter()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g1 = Generator{}(n);
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v.insert(g1[i]);
using step_t = iter_step<typename decltype(g1)::value_type>;
measure(meter, [&] {
volatile auto c = std::accumulate(v.begin(), v.end(), 0u, step_t{});
return c;
});
};
}
template <typename Generator, typename Set>
auto benchmark_access_reduce()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g1 = Generator{}(n);
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v = v.insert(g1[i]);
using step_t = iter_step<typename decltype(g1)::value_type>;
measure(meter, [&] {
volatile auto c = immer::accumulate(v, 0u, step_t{});
return c;
});
};
}
template <typename Generator, typename Set>
auto benchmark_access_iter()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g1 = Generator{}(n);
auto v = Set{};
for (auto i = 0u; i < n; ++i)
v = v.insert(g1[i]);
using step_t = iter_step<typename decltype(g1)::value_type>;
measure(meter, [&] {
volatile auto c = std::accumulate(v.begin(), v.end(), 0u, step_t{});
return c;
});
};
}
} // namespace

View file

@ -1,25 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "iter.hpp"
#ifndef GENERATOR_T
#error "you must define a GENERATOR_T"
#endif
using generator__ = GENERATOR_T;
using t__ = typename decltype(generator__{}(0))::value_type;
NONIUS_BENCHMARK("iter/std::set", benchmark_access_std_iter<generator__, std::set<t__>>())
NONIUS_BENCHMARK("iter/std::unordered_set", benchmark_access_std_iter<generator__, std::unordered_set<t__>>())
NONIUS_BENCHMARK("iter/boost::flat_set", benchmark_access_std_iter<generator__, boost::container::flat_set<t__>>())
NONIUS_BENCHMARK("iter/hamt::hash_trie", benchmark_access_std_iter<generator__, hamt::hash_trie<t__>>())
NONIUS_BENCHMARK("iter/immer::set/5B", benchmark_access_iter<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,def_memory,5>>())
NONIUS_BENCHMARK("iter/immer::set/4B", benchmark_access_iter<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,def_memory,4>>())
NONIUS_BENCHMARK("reduce/immer::set/5B", benchmark_access_reduce<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,def_memory,5>>())
NONIUS_BENCHMARK("reduce/immer::set/4B", benchmark_access_reduce<generator__, immer::set<t__, std::hash<t__>,std::equal_to<t__>,def_memory,4>>())

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "generator.ipp"
#include "../access.ipp"

View file

@ -1,46 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include <immer/box.hpp>
#include <random>
#include <vector>
#include <cassert>
#include <functional>
#include <algorithm>
#define GENERATOR_T generate_unsigned
namespace {
struct GENERATOR_T
{
static constexpr auto char_set = "_-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static constexpr auto max_length = 64;
static constexpr auto min_length = 8;
auto operator() (std::size_t runs) const
{
assert(runs > 0);
auto engine = std::default_random_engine{42};
auto dist = std::uniform_int_distribution<unsigned>{};
auto gen = std::bind(dist, engine);
auto r = std::vector<immer::box<std::string>>(runs);
std::generate_n(r.begin(), runs, [&] {
auto len = gen() % (max_length - min_length) + min_length;
auto str = std::string(len, ' ');
std::generate_n(str.begin(), len, [&] {
return char_set[gen() % sizeof(char_set)];
});
return str;
});
return r;
}
};
} // namespace

View file

@ -1,11 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define DISABLE_GC_BENCHMARKS
#include "generator.ipp"
#include "../insert.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "generator.ipp"
#include "../iter.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "generator.ipp"
#include "../access.ipp"

View file

@ -1,44 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include <random>
#include <vector>
#include <cassert>
#include <functional>
#include <algorithm>
#define GENERATOR_T generate_unsigned
namespace {
struct GENERATOR_T
{
static constexpr auto char_set = "_-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static constexpr auto max_length = 256;
static constexpr auto min_length = 32;
auto operator() (std::size_t runs) const
{
assert(runs > 0);
auto engine = std::default_random_engine{42};
auto dist = std::uniform_int_distribution<unsigned>{};
auto gen = std::bind(dist, engine);
auto r = std::vector<std::string>(runs);
std::generate_n(r.begin(), runs, [&] {
auto len = gen() % (max_length - min_length) + min_length;
auto str = std::string(len, ' ');
std::generate_n(str.begin(), len, [&] {
return char_set[gen() % sizeof(char_set)];
});
return str;
});
return r;
}
};
} // namespace

View file

@ -1,11 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define DISABLE_GC_BENCHMARKS
#include "generator.ipp"
#include "../insert.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "generator.ipp"
#include "../iter.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "generator.ipp"
#include "../access.ipp"

View file

@ -1,44 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include <random>
#include <vector>
#include <cassert>
#include <functional>
#include <algorithm>
#define GENERATOR_T generate_unsigned
namespace {
struct GENERATOR_T
{
static constexpr auto char_set = "_-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static constexpr auto max_length = 15;
static constexpr auto min_length = 4;
auto operator() (std::size_t runs) const
{
assert(runs > 0);
auto engine = std::default_random_engine{42};
auto dist = std::uniform_int_distribution<unsigned>{};
auto gen = std::bind(dist, engine);
auto r = std::vector<std::string>(runs);
std::generate_n(r.begin(), runs, [&] {
auto len = gen() % (max_length - min_length) + min_length;
auto str = std::string(len, ' ');
std::generate_n(str.begin(), len, [&] {
return char_set[gen() % sizeof(char_set)];
});
return str;
});
return r;
}
};
} // namespace

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "generator.ipp"
#include "../insert.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "generator.ipp"
#include "../iter.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "generator.ipp"
#include "../access.ipp"

View file

@ -1,32 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include <random>
#include <vector>
#include <cassert>
#include <functional>
#include <algorithm>
#define GENERATOR_T generate_unsigned
namespace {
struct GENERATOR_T
{
auto operator() (std::size_t runs) const
{
assert(runs > 0);
auto engine = std::default_random_engine{42};
auto dist = std::uniform_int_distribution<unsigned>{};
auto r = std::vector<unsigned>(runs);
std::generate_n(r.begin(), runs, std::bind(dist, engine));
return r;
}
};
} // namespace

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "generator.ipp"
#include "../insert.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "generator.ipp"
#include "../iter.ipp"

View file

@ -1,261 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include "benchmark/vector/common.hpp"
#include <immer/algorithm.hpp>
#if IMMER_BENCHMARK_BOOST_COROUTINE
#include <boost/coroutine2/all.hpp>
#endif
namespace {
template <typename Vektor>
auto benchmark_access_reduce_chunkedseq()
{
return [] (nonius::parameters params)
{
auto n = params.get<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v.push_back(i);
return [=] {
auto init = 0u;
v.for_each_segment([&] (auto first, auto last) {
init = std::accumulate(first, last, init);
});
return init;
};
};
}
template <typename Vektor>
auto benchmark_access_iter_std()
{
return [] (nonius::parameters params)
{
auto n = params.get<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v.push_back(i);
return [=] {
auto volatile x = std::accumulate(v.begin(), v.end(), 0u);
return x;
};
};
}
template <typename Vektor>
auto benchmark_access_idx_std()
{
return [] (nonius::parameters params)
{
auto n = params.get<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v.push_back(i);
return [=] {
auto r = 0u;
for (auto i = 0u; i < n; ++i)
r += v[i];
volatile auto rr = r;
return rr;
};
};
}
template <typename Vektor>
auto benchmark_access_random_std()
{
return [] (nonius::parameters params)
{
auto n = params.get<N>();
auto v = Vektor{};
auto g = make_generator(n);
for (auto i = 0u; i < n; ++i)
v.push_back(i);
return [=] {
auto r = 0u;
for (auto i = 0u; i < n; ++i)
r += v[g[i]];
volatile auto rr = r;
return rr;
};
};
}
template <typename Vektor, typename PushFn=push_back_fn>
auto benchmark_access_iter()
{
return [] (nonius::parameters params)
{
auto n = params.get<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
return [=] {
auto volatile x = std::accumulate(v.begin(), v.end(), 0u);
return x;
};
};
}
#if IMMER_BENCHMARK_BOOST_COROUTINE
template <typename Vektor, typename PushFn=push_back_fn>
auto benchmark_access_coro()
{
return [] (nonius::parameters params)
{
using coro_t = typename boost::coroutines2::coroutine<int>;
auto n = params.get<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
return [=] {
auto c = coro_t::pull_type { [&](auto& sink) {
v.for_each_chunk([&](auto f, auto l) {
for (; f != l; ++f)
sink(*f);
});
}};
auto volatile x = std::accumulate(begin(c), end(c), 0u);
return x;
};
};
}
#endif
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_access_idx()
{
return [] (nonius::parameters params)
{
auto n = params.get<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
return [=] {
auto r = 0u;
for (auto i = 0u; i < n; ++i)
r += v[i];
volatile auto rr = r;
return rr;
};
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_access_reduce()
{
return [] (nonius::parameters params)
{
auto n = params.get<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
return [=] {
auto volatile x = immer::accumulate(v, 0u);
return x;
};
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_access_reduce_range()
{
return [] (nonius::parameters params)
{
auto n = params.get<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
return [=] {
auto volatile x = immer::accumulate(v.begin(), v.end(), 0u);
return x;
};
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_access_random()
{
return [] (nonius::parameters params)
{
auto n = params.get<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
auto g = make_generator(n);
return [=] {
auto r = 0u;
for (auto i = 0u; i < n; ++i)
r += v[g[i]];
volatile auto rr = r;
return rr;
};
};
}
template <typename Fn>
auto benchmark_access_librrb(Fn maker)
{
return
[=] (nonius::parameters params) {
auto n = params.get<N>();
auto v = maker(n);
return
[=] {
auto r = 0u;
for (auto i = 0u; i < n; ++i)
r += reinterpret_cast<unsigned long>(rrb_nth(v, i));
volatile auto rr = r;
return rr;
};
};
}
template <typename Fn>
auto benchmark_access_random_librrb(Fn maker)
{
return
[=] (nonius::parameters params) {
auto n = params.get<N>();
auto v = maker(n);
auto g = make_generator(n);
return
[=] {
auto r = 0u;
for (auto i = 0u; i < n; ++i)
r += reinterpret_cast<unsigned long>(rrb_nth(v, g[i]));
volatile auto rr = r;
return rr;
};
};
}
} // anonymous namespace

View file

@ -1,245 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include "benchmark/vector/common.hpp"
namespace {
template <typename Vektor>
auto benchmark_assoc_std()
{
return
[] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = Vektor(n, 0);
std::iota(v.begin(), v.end(), 0u);
auto all = std::vector<Vektor>(meter.runs(), v);
meter.measure([&] (int iter) {
auto& r = all[iter];
for (auto i = 0u; i < n; ++i)
r[i] = n - i;
return r;
});
};
}
template <typename Vektor>
auto benchmark_assoc_random_std()
{
return
[](nonius::chronometer meter)
{
auto n = meter.param<N>();
auto g = make_generator(n);
auto v = Vektor(n, 0);
std::iota(v.begin(), v.end(), 0u);
auto all = std::vector<Vektor>(meter.runs(), v);
meter.measure([&] (int iter) {
auto& r = all[iter];
for (auto i = 0u; i < n; ++i)
r[g[i]] = n - i;
return r;
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn,
typename SetFn=set_fn>
auto benchmark_assoc()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
if (n > get_limit<Vektor>{})
nonius::skip();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
auto r = v;
for (auto i = 0u; i < n; ++i)
r = SetFn{}(r, i, n - i);
return r;
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_assoc_move()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
if (n > get_limit<Vektor>{})
nonius::skip();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
auto r = v;
for (auto i = 0u; i < n; ++i)
r = std::move(r).set(i, n - i);
return r;
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn,
typename SetFn=set_fn>
auto benchmark_assoc_random()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
if (n > get_limit<Vektor>{})
nonius::skip();
auto g = make_generator(n);
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
auto r = v;
for (auto i = 0u; i < n; ++i)
r = SetFn{}(r, g[i], i);
return r;
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_assoc_mut()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
if (n > get_limit<Vektor>{})
nonius::skip();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
auto r = v.transient();
for (auto i = 0u; i < n; ++i)
r.set(i, n - i);
return r;
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_assoc_mut_random()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
if (n > get_limit<Vektor>{})
nonius::skip();
auto g = make_generator(n);
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
auto r = v.transient();
for (auto i = 0u; i < n; ++i)
r.set(g[i], i);
return r;
});
};
}
template <typename Fn>
auto benchmark_assoc_librrb(Fn maker)
{
return
[=] (nonius::chronometer meter) {
auto n = meter.param<N>();
auto v = maker(n);
measure(
meter, [&] {
auto r = v;
for (auto i = 0u; i < n; ++i)
r = rrb_update(r, i, reinterpret_cast<void*>(n - i));
return r;
});
};
}
template <typename Fn>
auto benchmark_assoc_random_librrb(Fn maker)
{
return
[=] (nonius::chronometer meter) {
auto n = meter.param<N>();
auto v = maker(n);
auto g = make_generator(n);
measure(
meter, [&] {
auto r = v;
for (auto i = 0u; i < n; ++i)
r = rrb_update(r, g[i], reinterpret_cast<void*>(i));
return r;
});
};
}
template <typename Fn>
auto benchmark_assoc_mut_librrb(Fn maker)
{
return
[=] (nonius::chronometer meter) {
auto n = meter.param<N>();
auto v = maker(n);
measure(
meter, [&] {
auto r = rrb_to_transient(v);
for (auto i = 0u; i < n; ++i)
r = transient_rrb_update(
r, i, reinterpret_cast<void*>(i));
return r;
});
};
}
template <typename Fn>
auto benchmark_assoc_mut_random_librrb(Fn maker)
{
return
[=] (nonius::chronometer meter) {
auto n = meter.param<N>();
auto v = maker(n);
auto g = make_generator(n);
measure(
meter, [&] {
auto r = rrb_to_transient(v);
for (auto i = 0u; i < n; ++i)
r = transient_rrb_update(
r, g[i], reinterpret_cast<void*>(i));
return r;
});
};
}
} // anonymous namespace

View file

@ -1,20 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/access.hpp"
#include <immer/flex_vector.hpp>
#ifndef MEMORY_T
#error "define the MEMORY_T"
#endif
NONIUS_BENCHMARK("flex/3", benchmark_access_idx<immer::flex_vector<std::size_t,MEMORY_T,3>>())
NONIUS_BENCHMARK("flex/4", benchmark_access_idx<immer::flex_vector<std::size_t,MEMORY_T,4>>())
NONIUS_BENCHMARK("flex/5", benchmark_access_idx<immer::flex_vector<std::size_t,MEMORY_T,5>>())
NONIUS_BENCHMARK("flex/6", benchmark_access_idx<immer::flex_vector<std::size_t,MEMORY_T,6>>())
NONIUS_BENCHMARK("flex/7", benchmark_access_idx<immer::flex_vector<std::size_t,MEMORY_T,7>>())

View file

@ -1,20 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/assoc.hpp"
#include <immer/flex_vector.hpp>
#ifndef MEMORY_T
#error "define the MEMORY_T"
#endif
NONIUS_BENCHMARK("flex/3", benchmark_assoc<immer::flex_vector<std::size_t,MEMORY_T,3>>())
NONIUS_BENCHMARK("flex/4", benchmark_assoc<immer::flex_vector<std::size_t,MEMORY_T,4>>())
NONIUS_BENCHMARK("flex/5", benchmark_assoc<immer::flex_vector<std::size_t,MEMORY_T,5>>())
NONIUS_BENCHMARK("flex/6", benchmark_assoc<immer::flex_vector<std::size_t,MEMORY_T,6>>())
NONIUS_BENCHMARK("flex/7", benchmark_assoc<immer::flex_vector<std::size_t,MEMORY_T,7>>())

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T basic_memory
#include "../access.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T basic_memory
#include "../assoc.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T basic_memory
#include "../concat.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T basic_memory
#include "../push.ipp"

View file

@ -1,20 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/concat.hpp"
#include <immer/flex_vector.hpp>
#ifndef MEMORY_T
#error "define the MEMORY_T"
#endif
NONIUS_BENCHMARK("flex/3", benchmark_concat<immer::flex_vector<std::size_t,MEMORY_T,3>>())
NONIUS_BENCHMARK("flex/4", benchmark_concat<immer::flex_vector<std::size_t,MEMORY_T,4>>())
NONIUS_BENCHMARK("flex/5", benchmark_concat<immer::flex_vector<std::size_t,MEMORY_T,5>>())
NONIUS_BENCHMARK("flex/6", benchmark_concat<immer::flex_vector<std::size_t,MEMORY_T,6>>())
NONIUS_BENCHMARK("flex/7", benchmark_concat<immer::flex_vector<std::size_t,MEMORY_T,7>>())

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T gc_memory
#include "../access.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T gc_memory
#include "../assoc.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T gc_memory
#include "../concat.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T gc_memory
#include "../push.ipp"

View file

@ -1,20 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/push.hpp"
#include <immer/flex_vector.hpp>
#ifndef MEMORY_T
#error "define the MEMORY_T"
#endif
NONIUS_BENCHMARK("flex/3", benchmark_push<immer::flex_vector<std::size_t,MEMORY_T,3>>())
NONIUS_BENCHMARK("flex/4", benchmark_push<immer::flex_vector<std::size_t,MEMORY_T,4>>())
NONIUS_BENCHMARK("flex/5", benchmark_push<immer::flex_vector<std::size_t,MEMORY_T,5>>())
NONIUS_BENCHMARK("flex/6", benchmark_push<immer::flex_vector<std::size_t,MEMORY_T,6>>())
NONIUS_BENCHMARK("flex/7", benchmark_push<immer::flex_vector<std::size_t,MEMORY_T,7>>())

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T safe_memory
#include "../access.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T safe_memory
#include "../assoc.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T safe_memory
#include "../concat.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T safe_memory
#include "../push.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T unsafe_memory
#include "../access.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T unsafe_memory
#include "../assoc.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T unsafe_memory
#include "../concat.ipp"

View file

@ -1,10 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#define MEMORY_T unsafe_memory
#include "../push.ipp"

View file

@ -1,212 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include <utility>
#include <cstddef>
#include <limits>
#include "benchmark/config.hpp"
#if IMMER_BENCHMARK_LIBRRB
extern "C" {
#define restrict __restrict__
#include <rrb.h>
#undef restrict
}
#include <immer/heap/gc_heap.hpp>
#endif
namespace immer {
template <typename T, typename MP> class array;
} // namespace immer
namespace {
auto make_generator(std::size_t runs)
{
assert(runs > 0);
auto engine = std::default_random_engine{42};
auto dist = std::uniform_int_distribution<std::size_t>{0, runs-1};
auto r = std::vector<std::size_t>(runs);
std::generate_n(r.begin(), runs, std::bind(dist, engine));
return r;
}
struct push_back_fn
{
template <typename T, typename U>
auto operator() (T&& v, U&& x)
{ return std::forward<T>(v).push_back(std::forward<U>(x)); }
};
struct push_front_fn
{
template <typename T, typename U>
auto operator() (T&& v, U&& x)
{ return std::forward<T>(v).push_front(std::forward<U>(x)); }
};
struct set_fn
{
template <typename T, typename I, typename U>
decltype(auto) operator() (T&& v, I i, U&& x)
{ return std::forward<T>(v).set(i, std::forward<U>(x)); }
};
struct store_fn
{
template <typename T, typename I, typename U>
decltype(auto) operator() (T&& v, I i, U&& x)
{ return std::forward<T>(v).store(i, std::forward<U>(x)); }
};
template <typename T>
struct get_limit : std::integral_constant<
std::size_t, std::numeric_limits<std::size_t>::max()> {};
template <typename T, typename MP>
struct get_limit<immer::array<T, MP>> : std::integral_constant<
std::size_t, 10000> {};
auto make_librrb_vector(std::size_t n)
{
auto v = rrb_create();
for (auto i = 0u; i < n; ++i) {
v = rrb_push(v, reinterpret_cast<void*>(i));
}
return v;
}
auto make_librrb_vector_f(std::size_t n)
{
auto v = rrb_create();
for (auto i = 0u; i < n; ++i) {
auto f = rrb_push(rrb_create(),
reinterpret_cast<void*>(i));
v = rrb_concat(f, v);
}
return v;
}
// copied from:
// https://github.com/ivmai/bdwgc/blob/master/include/gc_allocator.h
template <class GC_tp>
struct GC_type_traits
{
std::false_type GC_is_ptr_free;
};
# define GC_DECLARE_PTRFREE(T) \
template<> struct GC_type_traits<T> { \
std::true_type GC_is_ptr_free; \
}
GC_DECLARE_PTRFREE(char);
GC_DECLARE_PTRFREE(signed char);
GC_DECLARE_PTRFREE(unsigned char);
GC_DECLARE_PTRFREE(signed short);
GC_DECLARE_PTRFREE(unsigned short);
GC_DECLARE_PTRFREE(signed int);
GC_DECLARE_PTRFREE(unsigned int);
GC_DECLARE_PTRFREE(signed long);
GC_DECLARE_PTRFREE(unsigned long);
GC_DECLARE_PTRFREE(float);
GC_DECLARE_PTRFREE(double);
GC_DECLARE_PTRFREE(long double);
template <class IsPtrFree>
inline void* GC_selective_alloc(size_t n, IsPtrFree, bool ignore_off_page)
{
return ignore_off_page
? GC_MALLOC_IGNORE_OFF_PAGE(n)
: GC_MALLOC(n);
}
template <>
inline void* GC_selective_alloc<std::true_type>(size_t n,
std::true_type,
bool ignore_off_page)
{
return ignore_off_page
? GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE(n)
: GC_MALLOC_ATOMIC(n);
}
template <class T>
class gc_allocator
{
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef T value_type;
template <class T1> struct rebind {
typedef gc_allocator<T1> other;
};
gc_allocator() {}
gc_allocator(const gc_allocator&) throw() {}
template <class T1>
explicit gc_allocator(const gc_allocator<T1>&) throw() {}
~gc_allocator() throw() {}
pointer address(reference GC_x) const { return &GC_x; }
const_pointer address(const_reference GC_x) const { return &GC_x; }
// GC_n is permitted to be 0. The C++ standard says nothing about what
// the return value is when GC_n == 0.
T* allocate(size_type GC_n, const void* = 0)
{
GC_type_traits<T> traits;
return static_cast<T *>
(GC_selective_alloc(GC_n * sizeof(T),
traits.GC_is_ptr_free, false));
}
// p is not permitted to be a null pointer.
void deallocate(pointer p, size_type /* GC_n */)
{ GC_FREE(p); }
size_type max_size() const throw()
{ return size_t(-1) / sizeof(T); }
void construct(pointer p, const T& __val) { new(p) T(__val); }
void destroy(pointer p) { p->~T(); }
};
template<>
class gc_allocator<void>
{
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
template <class T1> struct rebind {
typedef gc_allocator<T1> other;
};
};
template <class T1, class T2>
inline bool operator==(const gc_allocator<T1>&, const gc_allocator<T2>&)
{ return true; }
template <class T1, class T2>
inline bool operator!=(const gc_allocator<T1>&, const gc_allocator<T2>&)
{ return false; }
} // anonymous namespace

View file

@ -1,166 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include "benchmark/vector/common.hpp"
namespace {
constexpr auto concat_steps = 10u;
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_concat()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
return v + v;
});
};
}
template <typename Fn>
auto benchmark_concat_librrb(Fn maker)
{
return
[=] (nonius::chronometer meter) {
auto n = meter.param<N>();
auto v = maker(n);
measure(meter, [&] {
return rrb_concat(v, v);
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_concat_incr()
{
return
[] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = Vektor{};
for (auto i = 0u; i < n / concat_steps; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
auto r = Vektor{};
for (auto i = 0u; i < concat_steps; ++i)
r = r + v;
return r;
});
};
}
template <typename Vektor>
auto benchmark_concat_incr_mut()
{
return
[] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = Vektor{}.transient();
for (auto i = 0u; i < n / concat_steps; ++i)
v.push_back(i);
measure(meter, [&] (int run) {
auto r = Vektor{}.transient();
for (auto i = 0u; i < concat_steps; ++i)
r.append(v);
return r;
});
};
}
template <typename Vektor>
auto benchmark_concat_incr_mut2()
{
return
[] (nonius::chronometer meter)
{
auto n = meter.param<N>();
using transient_t = typename Vektor::transient_type;
using steps_t = std::vector<transient_t, gc_allocator<transient_t>>;
auto vs = std::vector<steps_t, gc_allocator<steps_t>>(meter.runs());
for (auto k = 0u; k < vs.size(); ++k) {
vs[k].reserve(concat_steps);
for (auto j = 0u; j < concat_steps; ++j) {
auto vv = Vektor{}.transient();
for (auto i = 0u; i < n / concat_steps; ++i)
vv.push_back(i);
vs[k].push_back(std::move(vv));
}
}
measure(meter, [&] (int run) {
auto& vr = vs[run];
auto r = Vektor{}.transient();
assert(vr.size() == concat_steps);
for (auto i = 0u; i < concat_steps; ++i)
r.append(std::move(vr[i]));
return r;
});
};
}
template <typename Vektor>
auto benchmark_concat_incr_chunkedseq()
{
return
[] (nonius::chronometer meter)
{
auto n = meter.param<N>();
using steps_t = std::vector<Vektor>;
auto vs = std::vector<steps_t>(meter.runs());
for (auto k = 0u; k < vs.size(); ++k) {
for (auto j = 0u; j < concat_steps; ++j) {
auto vv = Vektor{};
for (auto i = 0u; i < n / concat_steps; ++i)
vv.push_back(i);
vs[k].push_back(std::move(vv));
}
}
measure(meter, [&] (int run) {
auto& vr = vs[run];
auto r = Vektor{};
for (auto i = 0u; i < concat_steps; ++i)
r.concat(vr[i]);
return r;
});
};
}
template <typename Fn>
auto benchmark_concat_incr_librrb(Fn maker)
{
return
[=] (nonius::chronometer meter) {
auto n = meter.param<N>();
auto v = maker(n / concat_steps);
measure(meter, [&] {
auto r = rrb_create();
for (auto i = 0ul; i < concat_steps; ++i)
r = rrb_concat(r, v);
return r;
});
};
}
} // anonymous namespace

View file

@ -1,142 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include "benchmark/vector/common.hpp"
namespace {
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_drop()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
for (auto i = 0u; i < n; ++i)
(void) v.drop(i);
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_drop_lin()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
auto r = v;
for (auto i = 0u; i < n; ++i)
r = r.drop(1);
return r;
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_drop_move()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
auto r = v;
for (auto i = 0u; i < n; ++i)
r = std::move(r).drop(1);
return r;
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_drop_mut()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto vv = Vektor{};
for (auto i = 0u; i < n; ++i)
vv = PushFn{}(std::move(vv), i);
measure(meter, [&] {
auto v = vv.transient();
for (auto i = 0u; i < n; ++i)
(void) v.drop(1);
});
};
}
template <typename Fn>
auto benchmark_drop_librrb(Fn make)
{
return [=] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = make(n);
measure(meter, [&] {
for (auto i = 0u; i < n; ++i)
rrb_slice(v, i, n);
});
};
}
template <typename Fn>
auto benchmark_drop_lin_librrb(Fn make)
{
return [=] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = make(n);
measure(meter, [&] {
auto r = v;
for (auto i = 0u; i < n; ++i)
r = rrb_slice(r, 1, n);
return r;
});
};
}
template <typename Fn>
auto benchmark_drop_mut_librrb(Fn make)
{
return [=] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = make(n);
measure(meter, [&] {
auto r = rrb_to_transient(v);
for (auto i = 0u; i < n; ++i)
r = transient_rrb_slice(r, 1, n);
return r;
});
};
}
} // anonymous namespace

View file

@ -1,94 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/access.hpp"
#include <immer/algorithm.hpp>
#include <immer/array.hpp>
#include <immer/flex_vector.hpp>
#include <immer/vector.hpp>
#if IMMER_BENCHMARK_EXPERIMENTAL
#include <immer/experimental/dvektor.hpp>
#endif
#if IMMER_BENCHMARK_STEADY
#define QUARK_ASSERT_ON 0
#include <steady/steady_vector.h>
#endif
#include <vector>
#include <list>
#include <numeric>
NONIUS_BENCHMARK("std::vector", benchmark_access_iter_std<std::vector<unsigned>>())
NONIUS_BENCHMARK("std::vector/idx", benchmark_access_idx_std<std::vector<unsigned>>())
NONIUS_BENCHMARK("std::vector/random", benchmark_access_random_std<std::vector<unsigned>>())
NONIUS_BENCHMARK("std::list", benchmark_access_iter_std<std::list<unsigned>>())
#if IMMER_BENCHMARK_LIBRRB
NONIUS_BENCHMARK("librrb", benchmark_access_librrb(make_librrb_vector))
NONIUS_BENCHMARK("librrb/F", benchmark_access_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("librrb/random", benchmark_access_random_librrb(make_librrb_vector))
NONIUS_BENCHMARK("librrb/F/random", benchmark_access_random_librrb(make_librrb_vector_f))
#endif
NONIUS_BENCHMARK("flex/5B", benchmark_access_iter<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("flex/F/5B", benchmark_access_iter<immer::flex_vector<unsigned,def_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("vector/4B", benchmark_access_iter<immer::vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("vector/5B", benchmark_access_iter<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("vector/6B", benchmark_access_iter<immer::vector<unsigned,def_memory,6>>())
#if IMMER_BENCHMARK_EXPERIMENTAL
NONIUS_BENCHMARK("dvektor/4B", benchmark_access_iter<immer::dvektor<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("dvektor/5B", benchmark_access_iter<immer::dvektor<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("dvektor/6B", benchmark_access_iter<immer::dvektor<unsigned,def_memory,6>>())
#endif
#if IMMER_BENCHMARK_STEADY
NONIUS_BENCHMARK("steady/idx", benchmark_access_idx<steady::vector<unsigned>>())
#endif
NONIUS_BENCHMARK("flex/5B/idx", benchmark_access_idx<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("flex/F/5B/idx", benchmark_access_idx<immer::flex_vector<unsigned,def_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("vector/4B/idx", benchmark_access_idx<immer::vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("vector/5B/idx", benchmark_access_idx<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("vector/6B/idx", benchmark_access_idx<immer::vector<unsigned,def_memory,6>>())
#if IMMER_BENCHMARK_EXPERIMENTAL
NONIUS_BENCHMARK("dvektor/4B/idx", benchmark_access_idx<immer::dvektor<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("dvektor/5B/idx", benchmark_access_idx<immer::dvektor<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("dvektor/6B/idx", benchmark_access_idx<immer::dvektor<unsigned,def_memory,6>>())
#endif
NONIUS_BENCHMARK("flex/5B/reduce_i", benchmark_access_reduce_range<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("vector/5B/reduce_i", benchmark_access_reduce_range<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("flex/5B/reduce", benchmark_access_reduce<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("flex/F/5B/reduce", benchmark_access_reduce<immer::flex_vector<unsigned,def_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("vector/4B/reduce", benchmark_access_reduce<immer::vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("vector/5B/reduce", benchmark_access_reduce<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("vector/6B/reduce", benchmark_access_reduce<immer::vector<unsigned,def_memory,6>>())
#if IMMER_BENCHMARK_STEADY
NONIUS_BENCHMARK("steady/random", benchmark_access_random<steady::vector<unsigned>>())
#endif
NONIUS_BENCHMARK("flex/5B/random", benchmark_access_random<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("flex/F/5B/random", benchmark_access_random<immer::flex_vector<unsigned,def_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("vector/4B/random", benchmark_access_random<immer::vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("vector/5B/random", benchmark_access_random<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("vector/6B/random", benchmark_access_random<immer::vector<unsigned,def_memory,6>>())
#if IMMER_BENCHMARK_EXPERIMENTAL
NONIUS_BENCHMARK("dvektor/4B/random", benchmark_access_random<immer::dvektor<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("dvektor/5B/random", benchmark_access_random<immer::dvektor<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("dvektor/6B/random", benchmark_access_random<immer::dvektor<unsigned,def_memory,6>>())
#endif
#if IMMER_BENCHMARK_BOOST_COROUTINE
NONIUS_BENCHMARK("vector/5B/coro", benchmark_access_coro<immer::vector<unsigned,def_memory,5>>())
#endif

View file

@ -1,119 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/assoc.hpp"
#include <immer/array.hpp>
#include <immer/flex_vector.hpp>
#include <immer/flex_vector_transient.hpp>
#include <immer/vector.hpp>
#include <immer/vector_transient.hpp>
#if IMMER_BENCHMARK_EXPERIMENTAL
#include <immer/experimental/dvektor.hpp>
#endif
#include <immer/heap/gc_heap.hpp>
#include <immer/refcount/no_refcount_policy.hpp>
#include <immer/refcount/unsafe_refcount_policy.hpp>
#include <vector>
#include <list>
#if IMMER_BENCHMARK_STEADY
#define QUARK_ASSERT_ON 0
#include <steady/steady_vector.h>
#endif
#if IMMER_BENCHMARK_LIBRRB
extern "C" {
#define restrict __restrict__
#include <rrb.h>
#undef restrict
}
#endif
NONIUS_BENCHMARK("std::vector", benchmark_assoc_std<std::vector<unsigned>>())
NONIUS_BENCHMARK("std::vector/random", benchmark_assoc_random_std<std::vector<unsigned>>())
#if IMMER_BENCHMARK_LIBRRB
NONIUS_BENCHMARK("librrb", benchmark_assoc_librrb(make_librrb_vector))
NONIUS_BENCHMARK("librrb/F", benchmark_assoc_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("librrb/random", benchmark_assoc_random_librrb(make_librrb_vector))
NONIUS_BENCHMARK("t/librrb", benchmark_assoc_mut_librrb(make_librrb_vector))
NONIUS_BENCHMARK("t/librrb/F", benchmark_assoc_mut_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("t/librrb/random", benchmark_assoc_mut_random_librrb(make_librrb_vector))
#endif
#if IMMER_BENCHMARK_STEADY
NONIUS_BENCHMARK("steady", benchmark_assoc<steady::vector<unsigned>, push_back_fn, store_fn>())
#endif
NONIUS_BENCHMARK("flex/5B", benchmark_assoc<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("flex/F/5B", benchmark_assoc<immer::flex_vector<unsigned,def_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("flex/GC", benchmark_assoc<immer::flex_vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("flex/F/GC", benchmark_assoc<immer::flex_vector<unsigned,gc_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("flex/F/GCF", benchmark_assoc<immer::flex_vector<unsigned,gcf_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("flex_s/GC", benchmark_assoc<immer::flex_vector<std::size_t,gc_memory,5>>())
NONIUS_BENCHMARK("flex_s/F/GC",benchmark_assoc<immer::flex_vector<std::size_t,gc_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("flex_s/F/GCF",benchmark_assoc<immer::flex_vector<std::size_t,gcf_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("vector/4B", benchmark_assoc<immer::vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("vector/5B", benchmark_assoc<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("vector/6B", benchmark_assoc<immer::vector<unsigned,def_memory,6>>())
NONIUS_BENCHMARK("vector/GC", benchmark_assoc<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("vector/NO", benchmark_assoc<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("vector/UN", benchmark_assoc<immer::vector<unsigned,unsafe_memory,5>>())
#if IMMER_BENCHMARK_EXPERIMENTAL
NONIUS_BENCHMARK("dvektor/4B", benchmark_assoc<immer::dvektor<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("dvektor/5B", benchmark_assoc<immer::dvektor<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("dvektor/6B", benchmark_assoc<immer::dvektor<unsigned,def_memory,6>>())
NONIUS_BENCHMARK("dvektor/GC", benchmark_assoc<immer::dvektor<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("dvektor/NO", benchmark_assoc<immer::dvektor<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("dvektor/UN", benchmark_assoc<immer::dvektor<unsigned,unsafe_memory,5>>())
#endif
NONIUS_BENCHMARK("array", benchmark_assoc<immer::array<unsigned>>())
#if IMMER_BENCHMARK_STEADY
NONIUS_BENCHMARK("steady/random", benchmark_assoc_random<steady::vector<unsigned>, push_back_fn, store_fn>())
#endif
NONIUS_BENCHMARK("flex/5B/random", benchmark_assoc_random<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("vector/4B/random", benchmark_assoc_random<immer::vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("vector/5B/random", benchmark_assoc_random<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("vector/6B/random", benchmark_assoc_random<immer::vector<unsigned,def_memory,6>>())
#if IMMER_BENCHMARK_EXPERIMENTAL
NONIUS_BENCHMARK("dvektor/4B/random", benchmark_assoc_random<immer::dvektor<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("dvektor/5B/random", benchmark_assoc_random<immer::dvektor<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("dvektor/6B/random", benchmark_assoc_random<immer::dvektor<unsigned,def_memory,6>>())
#endif
NONIUS_BENCHMARK("array/random", benchmark_assoc_random<immer::array<unsigned>>())
NONIUS_BENCHMARK("t/vector/5B", benchmark_assoc_mut<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("t/vector/GC", benchmark_assoc_mut<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("t/vector/NO", benchmark_assoc_mut<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("t/vector/UN", benchmark_assoc_mut<immer::vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("t/flex/F/5B", benchmark_assoc_mut<immer::flex_vector<unsigned,def_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("m/vector/5B", benchmark_assoc_move<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("m/vector/GC", benchmark_assoc_move<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("m/vector/NO", benchmark_assoc_move<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("m/vector/UN", benchmark_assoc_move<immer::vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("m/flex/F/5B", benchmark_assoc_move<immer::flex_vector<unsigned,def_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("t/vector/5B/random", benchmark_assoc_mut_random<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("t/vector/GC/random", benchmark_assoc_mut_random<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("t/vector/NO/random", benchmark_assoc_mut_random<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("t/vector/UN/random", benchmark_assoc_mut_random<immer::vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("t/flex/F/5B/random", benchmark_assoc_mut_random<immer::flex_vector<unsigned,def_memory,5>,push_front_fn>())

View file

@ -1,49 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/concat.hpp"
#include <immer/flex_vector.hpp>
#include <immer/flex_vector_transient.hpp>
#include <immer/heap/gc_heap.hpp>
#include <immer/refcount/no_refcount_policy.hpp>
#include <immer/refcount/unsafe_refcount_policy.hpp>
#if IMMER_BENCHMARK_LIBRRB
extern "C" {
#define restrict __restrict__
#include <rrb.h>
#undef restrict
}
#endif
#if IMMER_BENCHMARK_LIBRRB
NONIUS_BENCHMARK("librrb", benchmark_concat_librrb(make_librrb_vector))
NONIUS_BENCHMARK("librrb/F", benchmark_concat_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("i/librrb", benchmark_concat_incr_librrb(make_librrb_vector))
#endif
NONIUS_BENCHMARK("flex/4B", benchmark_concat<immer::flex_vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("flex/5B", benchmark_concat<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("flex/6B", benchmark_concat<immer::flex_vector<unsigned,def_memory,6>>())
NONIUS_BENCHMARK("flex/GC", benchmark_concat<immer::flex_vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("flex_s/GC", benchmark_concat<immer::flex_vector<std::size_t,gc_memory,5>>())
NONIUS_BENCHMARK("flex/NO", benchmark_concat<immer::flex_vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("flex/UN", benchmark_concat<immer::flex_vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("flex/F/5B", benchmark_concat<immer::flex_vector<unsigned,def_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("flex/F/GC", benchmark_concat<immer::flex_vector<unsigned,gc_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("flex_s/F/GC", benchmark_concat<immer::flex_vector<std::size_t,gc_memory,5>,push_front_fn>())
NONIUS_BENCHMARK("i/flex/GC", benchmark_concat_incr<immer::flex_vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("i/flex_s/GC", benchmark_concat_incr<immer::flex_vector<std::size_t,gc_memory,5>>())
NONIUS_BENCHMARK("i/flex/5B", benchmark_concat_incr<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("i/flex/UN", benchmark_concat_incr<immer::flex_vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("m/flex/GC", benchmark_concat_incr_mut<immer::flex_vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("m/flex_s/GC", benchmark_concat_incr_mut<immer::flex_vector<std::size_t,gc_memory,5>>())

View file

@ -1,63 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/drop.hpp"
#include <immer/flex_vector.hpp>
#include <immer/flex_vector_transient.hpp>
#include <immer/heap/gc_heap.hpp>
#include <immer/refcount/no_refcount_policy.hpp>
#include <immer/refcount/unsafe_refcount_policy.hpp>
#if IMMER_BENCHMARK_LIBRRB
extern "C" {
#define restrict __restrict__
#include <rrb.h>
#undef restrict
}
#endif
#if IMMER_BENCHMARK_LIBRRB
NONIUS_BENCHMARK("librrb", benchmark_drop_librrb(make_librrb_vector))
NONIUS_BENCHMARK("librrb/F", benchmark_drop_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("l/librrb", benchmark_drop_lin_librrb(make_librrb_vector))
NONIUS_BENCHMARK("l/librrb/F", benchmark_drop_lin_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("t/librrb", benchmark_drop_mut_librrb(make_librrb_vector))
NONIUS_BENCHMARK("t/librrb/F", benchmark_drop_mut_librrb(make_librrb_vector_f))
#endif
NONIUS_BENCHMARK("flex/4B", benchmark_drop<immer::flex_vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("flex/5B", benchmark_drop<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("flex/6B", benchmark_drop<immer::flex_vector<unsigned,def_memory,6>>())
NONIUS_BENCHMARK("flex/GC", benchmark_drop<immer::flex_vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("flex/NO", benchmark_drop<immer::flex_vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("flex/UN", benchmark_drop<immer::flex_vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("flex_s/GC", benchmark_drop<immer::flex_vector<std::size_t,gc_memory,5>>())
NONIUS_BENCHMARK("flex/F/5B", benchmark_drop<immer::flex_vector<unsigned,def_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("flex/F/GC", benchmark_drop<immer::flex_vector<unsigned,gc_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("flex/F/GCF", benchmark_drop<immer::flex_vector<unsigned,gcf_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("flex_s/F/GC", benchmark_drop<immer::flex_vector<std::size_t,gc_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("l/flex/5B", benchmark_drop_lin<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("l/flex/GC", benchmark_drop_lin<immer::flex_vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("l/flex/NO", benchmark_drop_lin<immer::flex_vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("l/flex/UN", benchmark_drop_lin<immer::flex_vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("l/flex/F/5B", benchmark_drop_lin<immer::flex_vector<unsigned,def_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("m/flex/5B", benchmark_drop_move<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("m/flex/GC", benchmark_drop_move<immer::flex_vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("m/flex/NO", benchmark_drop_move<immer::flex_vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("m/flex/UN", benchmark_drop_move<immer::flex_vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("m/flex/F/5B", benchmark_drop_move<immer::flex_vector<unsigned,def_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("t/flex/5B", benchmark_drop_mut<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("t/flex/GC", benchmark_drop_mut<immer::flex_vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("t/flex/NO", benchmark_drop_mut<immer::flex_vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("t/flex/UN", benchmark_drop_mut<immer::flex_vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("t/flex/F/5B", benchmark_drop_mut<immer::flex_vector<unsigned,def_memory,5>, push_front_fn>())

View file

@ -1,30 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/push_front.hpp"
#include <immer/flex_vector.hpp>
#if IMMER_BENCHMARK_LIBRRB
extern "C" {
#define restrict __restrict__
#include <rrb.h>
#undef restrict
}
#endif
#if IMMER_BENCHMARK_LIBRRB
NONIUS_BENCHMARK("librrb", benchmark_push_front_librrb)
#endif
NONIUS_BENCHMARK("flex/4B", bechmark_push_front<immer::flex_vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("flex/5B", bechmark_push_front<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("flex/6B", bechmark_push_front<immer::flex_vector<unsigned,def_memory,6>>())
NONIUS_BENCHMARK("flex/GC", bechmark_push_front<immer::flex_vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("flex_s/GC", bechmark_push_front<immer::flex_vector<std::size_t,gc_memory,5>>())
NONIUS_BENCHMARK("flex/NO", bechmark_push_front<immer::flex_vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("flex/UN", bechmark_push_front<immer::flex_vector<unsigned,unsafe_memory,5>>())

View file

@ -1,83 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/push.hpp"
#include <immer/array.hpp>
#include <immer/flex_vector.hpp>
#include <immer/vector_transient.hpp>
#include <immer/vector.hpp>
#if IMMER_BENCHMARK_EXPERIMENTAL
#include <immer/experimental/dvektor.hpp>
#endif
#include <immer/heap/gc_heap.hpp>
#include <immer/refcount/no_refcount_policy.hpp>
#include <immer/refcount/unsafe_refcount_policy.hpp>
#include <vector>
#include <list>
#include <numeric>
#if IMMER_BENCHMARK_STEADY
#define QUARK_ASSERT_ON 0
#include <steady/steady_vector.h>
#endif
#if IMMER_BENCHMARK_LIBRRB
extern "C" {
#define restrict __restrict__
#include <rrb.h>
#undef restrict
}
#endif
#if IMMER_BENCHMARK_LIBRRB
NONIUS_BENCHMARK("librrb", benchmark_push_librrb)
NONIUS_BENCHMARK("t/librrb", benchmark_push_mut_librrb)
#endif
NONIUS_BENCHMARK("std::vector", benchmark_push_mut_std<std::vector<unsigned>>())
NONIUS_BENCHMARK("std::list", benchmark_push_mut_std<std::list<unsigned>>())
NONIUS_BENCHMARK("m/vector/5B", benchmark_push_move<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("m/vector/GC", benchmark_push_move<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("m/vector/NO", benchmark_push_move<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("t/vector/5B", benchmark_push_mut<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("t/vector/GC", benchmark_push_mut<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("t/vector/NO", benchmark_push_mut<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("t/vector/UN", benchmark_push_mut<immer::vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("flex/5B", benchmark_push<immer::flex_vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("flex_s/GC", benchmark_push<immer::flex_vector<std::size_t,gc_memory,5>>())
NONIUS_BENCHMARK("vector/4B", benchmark_push<immer::vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("vector/5B", benchmark_push<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("vector/6B", benchmark_push<immer::vector<unsigned,def_memory,6>>())
NONIUS_BENCHMARK("vector/GC", benchmark_push<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("vector/NO", benchmark_push<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("vector/UN", benchmark_push<immer::vector<unsigned,unsafe_memory,5>>())
#if IMMER_BENCHMARK_EXPERIMENTAL
NONIUS_BENCHMARK("dvektor/4B", benchmark_push<immer::dvektor<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("dvektor/5B", benchmark_push<immer::dvektor<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("dvektor/6B", benchmark_push<immer::dvektor<unsigned,def_memory,6>>())
NONIUS_BENCHMARK("dvektor/GC", benchmark_push<immer::dvektor<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("dvektor/NO", benchmark_push<immer::dvektor<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("dvektor/UN", benchmark_push<immer::dvektor<unsigned,unsafe_memory,5>>())
#endif
NONIUS_BENCHMARK("array", benchmark_push<immer::array<unsigned>>())
#if IMMER_BENCHMARK_STEADY
NONIUS_BENCHMARK("steady", benchmark_push<steady::vector<unsigned>>())
#endif

View file

@ -1,65 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/take.hpp"
#include <immer/vector.hpp>
#include <immer/flex_vector.hpp>
#include <immer/vector_transient.hpp>
#include <immer/flex_vector_transient.hpp>
#include <immer/heap/gc_heap.hpp>
#include <immer/refcount/no_refcount_policy.hpp>
#include <immer/refcount/unsafe_refcount_policy.hpp>
#if IMMER_BENCHMARK_LIBRRB
extern "C" {
#define restrict __restrict__
#include <rrb.h>
#undef restrict
}
#endif
#if IMMER_BENCHMARK_LIBRRB
NONIUS_BENCHMARK("librrb", benchmark_take_librrb(make_librrb_vector))
NONIUS_BENCHMARK("librrb/F", benchmark_take_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("l/librrb", benchmark_take_lin_librrb(make_librrb_vector))
NONIUS_BENCHMARK("l/librrb/F", benchmark_take_lin_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("t/librrb", benchmark_take_mut_librrb(make_librrb_vector))
NONIUS_BENCHMARK("t/librrb/F", benchmark_take_mut_librrb(make_librrb_vector_f))
#endif
NONIUS_BENCHMARK("vector/4B", benchmark_take<immer::vector<unsigned,def_memory,4>>())
NONIUS_BENCHMARK("vector/5B", benchmark_take<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("vector/6B", benchmark_take<immer::vector<unsigned,def_memory,6>>())
NONIUS_BENCHMARK("vector/GC", benchmark_take<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("vector/NO", benchmark_take<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("vector/UN", benchmark_take<immer::vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("vector_s/GC", benchmark_take<immer::vector<std::size_t,gc_memory,5>>())
NONIUS_BENCHMARK("flex/F/5B", benchmark_take<immer::flex_vector<unsigned,def_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("flex/F/GC", benchmark_take<immer::flex_vector<unsigned,gc_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("flex/F/GCF", benchmark_take<immer::flex_vector<unsigned,gcf_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("flex_s/F/GC", benchmark_take<immer::flex_vector<std::size_t,gc_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("l/vector/5B", benchmark_take_lin<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("l/vector/GC", benchmark_take_lin<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("l/vector/NO", benchmark_take_lin<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("l/vector/UN", benchmark_take_lin<immer::vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("l/flex/F/5B", benchmark_take_lin<immer::flex_vector<unsigned,def_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("m/vector/5B", benchmark_take_move<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("m/vector/GC", benchmark_take_move<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("m/vector/NO", benchmark_take_move<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("m/vector/UN", benchmark_take_move<immer::vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("m/flex/F/5B", benchmark_take_move<immer::flex_vector<unsigned,def_memory,5>, push_front_fn>())
NONIUS_BENCHMARK("t/vector/5B", benchmark_take_mut<immer::vector<unsigned,def_memory,5>>())
NONIUS_BENCHMARK("t/vector/GC", benchmark_take_mut<immer::vector<unsigned,gc_memory,5>>())
NONIUS_BENCHMARK("t/vector/NO", benchmark_take_mut<immer::vector<unsigned,basic_memory,5>>())
NONIUS_BENCHMARK("t/vector/UN", benchmark_take_mut<immer::vector<unsigned,unsafe_memory,5>>())
NONIUS_BENCHMARK("t/flex/F/5B", benchmark_take_mut<immer::flex_vector<unsigned,def_memory,5>, push_front_fn>())

View file

@ -1,31 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/access.hpp"
#include <immer/flex_vector.hpp>
#include <chunkedseq/chunkedseq.hpp>
NONIUS_BENCHMARK("idx owrs", benchmark_access_idx<immer::flex_vector<unsigned,def_memory>>())
NONIUS_BENCHMARK("idx librrb", benchmark_access_librrb(make_librrb_vector))
NONIUS_BENCHMARK("idx relaxed owrs", benchmark_access_idx<immer::flex_vector<unsigned,def_memory>,push_front_fn>())
NONIUS_BENCHMARK("idx relaxed librrb", benchmark_access_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("idx std::vector", benchmark_access_idx_std<std::vector<unsigned>>())
NONIUS_BENCHMARK("idx chunkedseq32", benchmark_access_idx_std<pasl::data::chunkedseq::bootstrapped::deque<unsigned, 32>>())
NONIUS_BENCHMARK("idx chunkedseq", benchmark_access_idx_std<pasl::data::chunkedseq::bootstrapped::deque<unsigned>>())
NONIUS_BENCHMARK("iter orws", benchmark_access_iter<immer::flex_vector<unsigned,def_memory>>())
NONIUS_BENCHMARK("iter relaxed orws", benchmark_access_iter<immer::flex_vector<unsigned,def_memory>,push_front_fn>())
NONIUS_BENCHMARK("iter chunkedseq32", benchmark_access_iter_std<pasl::data::chunkedseq::bootstrapped::deque<unsigned, 32>>())
NONIUS_BENCHMARK("iter chunkedseq", benchmark_access_iter_std<pasl::data::chunkedseq::bootstrapped::deque<unsigned>>())
NONIUS_BENCHMARK("reduce owrs", benchmark_access_reduce<immer::flex_vector<unsigned,def_memory>>())
NONIUS_BENCHMARK("reduce relaxed owrs", benchmark_access_reduce<immer::flex_vector<unsigned,def_memory>,push_front_fn>())
NONIUS_BENCHMARK("reduce chunkedseq32", benchmark_access_reduce_chunkedseq<pasl::data::chunkedseq::bootstrapped::deque<unsigned, 32>>())
NONIUS_BENCHMARK("reduce chunkedseq", benchmark_access_reduce_chunkedseq<pasl::data::chunkedseq::bootstrapped::deque<unsigned>>())
NONIUS_BENCHMARK("reduce std::vector", benchmark_access_iter_std<std::vector<unsigned>>())
NONIUS_BENCHMARK("reduce std::list", benchmark_access_iter_std<std::list<unsigned>>())

View file

@ -1,40 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/assoc.hpp"
#include <immer/flex_vector.hpp>
#include <immer/flex_vector_transient.hpp>
#include <chunkedseq/chunkedseq.hpp>
NONIUS_BENCHMARK("ours/basic", benchmark_assoc_random<immer::flex_vector<unsigned,basic_memory>>())
NONIUS_BENCHMARK("ours/safe", benchmark_assoc_random<immer::flex_vector<unsigned,def_memory>>())
NONIUS_BENCHMARK("ours/unsafe", benchmark_assoc_random<immer::flex_vector<unsigned,unsafe_memory>>())
NONIUS_BENCHMARK("ours/gc", benchmark_assoc_random<immer::flex_vector<unsigned,gc_memory>>())
NONIUS_BENCHMARK("librrb", benchmark_assoc_random_librrb(make_librrb_vector))
NONIUS_BENCHMARK("relaxed ours/basic", benchmark_assoc_random<immer::flex_vector<unsigned,basic_memory>,push_front_fn>())
NONIUS_BENCHMARK("relaxed ours/safe", benchmark_assoc_random<immer::flex_vector<unsigned,def_memory>,push_front_fn>())
NONIUS_BENCHMARK("relaxed ours/unsafe", benchmark_assoc_random<immer::flex_vector<unsigned,unsafe_memory>,push_front_fn>())
NONIUS_BENCHMARK("relaxed ours/gc", benchmark_assoc_random<immer::flex_vector<unsigned,gc_memory>,push_front_fn>())
NONIUS_BENCHMARK("relaxed librrb", benchmark_assoc_random_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("transient ours/basic", benchmark_assoc_mut_random<immer::flex_vector<unsigned,basic_memory>>())
NONIUS_BENCHMARK("transient ours/safe", benchmark_assoc_mut_random<immer::flex_vector<unsigned,def_memory>>())
NONIUS_BENCHMARK("transient ours/unsafe", benchmark_assoc_mut_random<immer::flex_vector<unsigned,unsafe_memory>>())
NONIUS_BENCHMARK("transient ours/gc", benchmark_assoc_mut_random<immer::flex_vector<unsigned,gc_memory>>())
NONIUS_BENCHMARK("transient librrb", benchmark_assoc_mut_random_librrb(make_librrb_vector))
NONIUS_BENCHMARK("transient relaxed ours/basic", benchmark_assoc_mut_random<immer::flex_vector<unsigned,basic_memory>,push_back_fn>())
NONIUS_BENCHMARK("transient relaxed ours/safe", benchmark_assoc_mut_random<immer::flex_vector<unsigned,def_memory>,push_back_fn>())
NONIUS_BENCHMARK("transient relaxed ours/unsafe", benchmark_assoc_mut_random<immer::flex_vector<unsigned,unsafe_memory>,push_back_fn>())
NONIUS_BENCHMARK("transient relaxed ours/gc", benchmark_assoc_mut_random<immer::flex_vector<unsigned,gc_memory>,push_back_fn>())
NONIUS_BENCHMARK("transient relaxed librrb", benchmark_assoc_mut_random_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("transient std::vector", benchmark_assoc_random_std<std::vector<unsigned>>())
NONIUS_BENCHMARK("transient chunkedseq32", benchmark_assoc_random_std<pasl::data::chunkedseq::bootstrapped::deque<unsigned>>())
NONIUS_BENCHMARK("transient chunkedseq", benchmark_assoc_random_std<pasl::data::chunkedseq::bootstrapped::deque<unsigned, 32>>())

View file

@ -1,40 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/assoc.hpp"
#include <immer/flex_vector.hpp>
#include <immer/flex_vector_transient.hpp>
#include <chunkedseq/chunkedseq.hpp>
NONIUS_BENCHMARK("ours/basic", benchmark_assoc<immer::flex_vector<unsigned,basic_memory>>())
NONIUS_BENCHMARK("ours/safe", benchmark_assoc<immer::flex_vector<unsigned,def_memory>>())
NONIUS_BENCHMARK("ours/unsafe", benchmark_assoc<immer::flex_vector<unsigned,unsafe_memory>>())
NONIUS_BENCHMARK("ours/gc", benchmark_assoc<immer::flex_vector<unsigned,gc_memory>>())
NONIUS_BENCHMARK("librrb", benchmark_assoc_librrb(make_librrb_vector))
NONIUS_BENCHMARK("relaxed ours/basic", benchmark_assoc<immer::flex_vector<unsigned,basic_memory>,push_front_fn>())
NONIUS_BENCHMARK("relaxed ours/safe", benchmark_assoc<immer::flex_vector<unsigned,def_memory>,push_front_fn>())
NONIUS_BENCHMARK("relaxed ours/unsafe", benchmark_assoc<immer::flex_vector<unsigned,unsafe_memory>,push_front_fn>())
NONIUS_BENCHMARK("relaxed ours/gc", benchmark_assoc<immer::flex_vector<unsigned,gc_memory>,push_front_fn>())
NONIUS_BENCHMARK("relaxed librrb", benchmark_assoc_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("transient ours/basic", benchmark_assoc_mut<immer::flex_vector<unsigned,basic_memory>>())
NONIUS_BENCHMARK("transient ours/safe", benchmark_assoc_mut<immer::flex_vector<unsigned,def_memory>>())
NONIUS_BENCHMARK("transient ours/unsafe", benchmark_assoc_mut<immer::flex_vector<unsigned,unsafe_memory>>())
NONIUS_BENCHMARK("transient ours/gc", benchmark_assoc_mut<immer::flex_vector<unsigned,gc_memory>>())
NONIUS_BENCHMARK("transient librrb", benchmark_assoc_mut_librrb(make_librrb_vector))
NONIUS_BENCHMARK("transient relaxed ours/basic", benchmark_assoc_mut<immer::flex_vector<unsigned,basic_memory>,push_back_fn>())
NONIUS_BENCHMARK("transient relaxed ours/safe", benchmark_assoc_mut<immer::flex_vector<unsigned,def_memory>,push_back_fn>())
NONIUS_BENCHMARK("transient relaxed ours/unsafe", benchmark_assoc_mut<immer::flex_vector<unsigned,unsafe_memory>,push_back_fn>())
NONIUS_BENCHMARK("transient relaxed ours/gc", benchmark_assoc_mut<immer::flex_vector<unsigned,gc_memory>,push_back_fn>())
NONIUS_BENCHMARK("transient relaxed librrb", benchmark_assoc_mut_librrb(make_librrb_vector_f))
NONIUS_BENCHMARK("transient std::vector", benchmark_assoc_std<std::vector<unsigned>>())
NONIUS_BENCHMARK("transient chunkedseq32", benchmark_assoc_std<pasl::data::chunkedseq::bootstrapped::deque<unsigned, 32>>())
NONIUS_BENCHMARK("transient chunkedseq", benchmark_assoc_std<pasl::data::chunkedseq::bootstrapped::deque<unsigned>>())

View file

@ -1,22 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/concat.hpp"
#include <immer/flex_vector.hpp>
#include <immer/flex_vector_transient.hpp>
#include <chunkedseq/chunkedseq.hpp>
NONIUS_BENCHMARK("ours/basic", benchmark_concat_incr<immer::flex_vector<unsigned,basic_memory>>())
NONIUS_BENCHMARK("ours/safe", benchmark_concat_incr<immer::flex_vector<unsigned,def_memory>>())
NONIUS_BENCHMARK("ours/unsafe", benchmark_concat_incr<immer::flex_vector<unsigned,unsafe_memory>>())
NONIUS_BENCHMARK("ours/gc", benchmark_concat_incr<immer::flex_vector<unsigned,gc_memory>>())
NONIUS_BENCHMARK("librrb", benchmark_concat_incr_librrb(make_librrb_vector))
NONIUS_BENCHMARK("transient ours/gc", benchmark_concat_incr_mut<immer::flex_vector<unsigned,gc_memory>>())
NONIUS_BENCHMARK("transient chunkedseq32", benchmark_concat_incr_chunkedseq<pasl::data::chunkedseq::bootstrapped::deque<unsigned, 32>>())
NONIUS_BENCHMARK("transient chunkedseq", benchmark_concat_incr_chunkedseq<pasl::data::chunkedseq::bootstrapped::deque<unsigned>>())

View file

@ -1,28 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#include "benchmark/vector/push.hpp"
#include <immer/flex_vector.hpp>
#include <immer/flex_vector_transient.hpp>
#include <chunkedseq/chunkedseq.hpp>
NONIUS_BENCHMARK("ours/basic", benchmark_push<immer::flex_vector<unsigned,basic_memory>>())
NONIUS_BENCHMARK("ours/safe", benchmark_push<immer::flex_vector<unsigned,def_memory>>())
NONIUS_BENCHMARK("ours/unsafe", benchmark_push<immer::flex_vector<unsigned,unsafe_memory>>())
NONIUS_BENCHMARK("ours/gc", benchmark_push<immer::flex_vector<unsigned,gc_memory>>())
NONIUS_BENCHMARK("librrb", benchmark_push_librrb)
NONIUS_BENCHMARK("transient ours/basic", benchmark_push_mut<immer::flex_vector<unsigned,basic_memory>>())
NONIUS_BENCHMARK("transient ours/safe", benchmark_push_mut<immer::flex_vector<unsigned,def_memory>>())
NONIUS_BENCHMARK("transient ours/unsafe", benchmark_push_mut<immer::flex_vector<unsigned,unsafe_memory>>())
NONIUS_BENCHMARK("transient ours/gc", benchmark_push_mut<immer::flex_vector<unsigned,gc_memory>>())
NONIUS_BENCHMARK("transient librrb", benchmark_push_mut_librrb)
NONIUS_BENCHMARK("transient std::vector", benchmark_push_mut_std<std::vector<unsigned>>())
NONIUS_BENCHMARK("transient std::list", benchmark_push_mut_std<std::list<unsigned>>())
NONIUS_BENCHMARK("transient chunkedseq32", benchmark_push_mut_std<pasl::data::chunkedseq::bootstrapped::deque<unsigned, 32>>())
NONIUS_BENCHMARK("transient chunkedseq", benchmark_push_mut_std<pasl::data::chunkedseq::bootstrapped::deque<unsigned>>())

View file

@ -1,111 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include "benchmark/vector/common.hpp"
namespace {
template <typename Vektor>
auto benchmark_push_mut_std()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
if (n > get_limit<Vektor>{})
nonius::skip();
measure(meter, [&] {
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v.push_back(i);
return v;
});
};
}
template <typename Vektor>
auto benchmark_push_mut()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
if (n > get_limit<Vektor>{})
nonius::skip();
measure(meter, [&] {
auto v = Vektor{}.transient();
for (auto i = 0u; i < n; ++i)
v.push_back(i);
return v;
});
};
}
template <typename Vektor>
auto benchmark_push_move()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
if (n > get_limit<Vektor>{})
nonius::skip();
measure(meter, [&] {
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = std::move(v).push_back(i);
return v;
});
};
}
template <typename Vektor>
auto benchmark_push()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
if (n > get_limit<Vektor>{})
nonius::skip();
measure(meter, [&] {
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = v.push_back(i);
return v;
});
};
}
auto benchmark_push_librrb(nonius::chronometer meter)
{
auto n = meter.param<N>();
measure(meter, [&] {
auto v = rrb_create();
for (auto i = 0u; i < n; ++i)
v = rrb_push(v, reinterpret_cast<void*>(i));
return v;
});
}
auto benchmark_push_mut_librrb(nonius::chronometer meter)
{
auto n = meter.param<N>();
measure(meter, [&] {
auto v = rrb_to_transient(rrb_create());
for (auto i = 0u; i < n; ++i)
v = transient_rrb_push(v, reinterpret_cast<void*>(i));
return v;
});
}
} // anonymous namespace

View file

@ -1,46 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include "benchmark/vector/common.hpp"
namespace {
template <typename Vektor>
auto bechmark_push_front()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
measure(meter, [&] {
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = v.push_front(i);
return v;
});
};
}
auto benchmark_push_front_librrb(nonius::chronometer meter)
{
auto n = meter.param<N>();
measure(meter, [&] {
auto v = rrb_create();
for (auto i = 0u; i < n; ++i) {
auto f = rrb_push(rrb_create(),
reinterpret_cast<void*>(i));
v = rrb_concat(f, v);
}
return v;
});
}
} // anonymous namespace

View file

@ -1,144 +0,0 @@
//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
//
#pragma once
#include "benchmark/vector/common.hpp"
namespace {
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_take()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
for (auto i = 0u; i < n; ++i)
(void) v.take(i);
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_take_lin()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
auto r = v;
for (auto i = n; i > 0; --i)
r = r.take(i);
return r;
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_take_move()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = Vektor{};
for (auto i = 0u; i < n; ++i)
v = PushFn{}(std::move(v), i);
measure(meter, [&] {
auto r = v;
for (auto i = n; i > 0; --i)
r = std::move(r).take(i);
return r;
});
};
}
template <typename Vektor,
typename PushFn=push_back_fn>
auto benchmark_take_mut()
{
return [] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto vv = Vektor{};
for (auto i = 0u; i < n; ++i)
vv = PushFn{}(std::move(vv), i);
measure(meter, [&] {
auto v = vv.transient();
for (auto i = n; i > 0; --i)
(void) v.take(i);
});
};
}
template <typename Fn>
auto benchmark_take_librrb(Fn make)
{
return [=] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = make(n);
measure(meter, [&] {
for (auto i = 0u; i < n; ++i)
rrb_slice(v, 0, i);
});
};
}
template <typename Fn>
auto benchmark_take_lin_librrb(Fn make)
{
return [=] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = make(n);
measure(
meter, [&] {
auto r = v;
for (auto i = n; i > 0; --i)
r = rrb_slice(r, 0, i);
return r;
});
};
}
template <typename Fn>
auto benchmark_take_mut_librrb(Fn make)
{
return [=] (nonius::chronometer meter)
{
auto n = meter.param<N>();
auto v = make(n);
measure(
meter, [&] {
auto r = rrb_to_transient(v);
for (auto i = n; i > 0; --i)
r = transient_rrb_slice(r, 0, i);
return r;
});
};
}
} // anonymous namespace

View file

@ -1,108 +0,0 @@
# - Try to find Boehm GC
# Once done, this will define
#
# BOEHM_GC_FOUND - system has Boehm GC
# BOEHM_GC_INCLUDE_DIR - the Boehm GC include directories
# BOEHM_GC_LIBRARIES - link these to use Boehm GC
#
# Copyright (c) 2010-2015 Takashi Kato <ktakashi@ymail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id: $
#
# CMake module to find Boehm GC
# use pkg-config if available
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_BDW_GC QUIET bdw-gc)
# try newer one first in case of gc.h is overwritten.
FIND_PATH(BOEHM_GC_INCLUDE_DIR gc/gc.h
HINTS ${PC_BDW_GC_INCLUDEDIR} ${PC_BDW_GC_INCLUDE_DIRS})
IF (NOT BOEHM_GC_INCLUDE_DIR)
FIND_PATH(BOEHM_GC_INCLUDE_DIR gc.h
HINTS ${PC_BDW_GC_INCLUDEDIR} ${PC_BDW_GC_INCLUDE_DIRS})
IF (BOEHM_GC_INCLUDE_DIR)
SET(HAVE_GC_H TRUE)
ENDIF()
ELSE()
SET(HAVE_GC_GC_H TRUE)
ENDIF()
# For FreeBSD we need to use gc-threaded
IF (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
# checks if 'gc' supports 'GC_get_parallel' and if it does
# then use it
INCLUDE(${CMAKE_ROOT}/Modules/CheckCSourceCompiles.cmake)
# not sure if this links properly...
FIND_LIBRARY(BOEHM_GC_LIBRARIES NAMES gc
HINTS ${PC_BDW_GC_LIBDIR} ${PC_BDW_GC_LIBRARY_DIRS})
MESSAGE(STATUS "GC library ${BOEHM_GC_LIBRARIES}")
SET(CMAKE_REQUIRED_LIBRARIES "gc")
SET(CMAKE_REQUIRED_DEFINITIONS "-DGC_THREADS")
SET(CMAKE_REQUIRED_INCLUDES "${BOEHM_GC_INCLUDE_DIR}")
SET(CMAKE_REQUIRED_FLAGS "-L${PC_BDW_GC_LIBRARY_DIRS}")
MESSAGE(STATUS "Boehm GC include dir: ${CMAKE_REQUIRED_INCLUDES}")
CHECK_C_SOURCE_RUNS(
"#include <gc.h>
int main() {
int i= GC_get_parallel();
return 0;
}
" GC_GET_PARALLEL_WORKS)
IF (NOT GC_GET_PARALLEL_WORKS)
MESSAGE(STATUS "Try gc-threaded")
# bdw-gc-threaded is the proper name for FreeBSD pkg-config
PKG_CHECK_MODULES(PC_BDW_GC_THREADED bdw-gc-threaded)
FIND_LIBRARY(BOEHM_GC_THREADED_LIBRARIES NAMES gc-threaded
HINTS ${PC_BDW_GC_THREADED_LIBDIR} ${PC_BDW_GC_THREADED_THREADED_DIRS})
MESSAGE(STATUS "GC threaded library ${BOEHM_GC_THREADED_LIBRARIES}")
IF (BOEHM_GC_THREADED_LIBRARIES)
# OK just use it
SET(BOEHM_GC_LIBRARIES "${BOEHM_GC_THREADED_LIBRARIES}")
ENDIF()
ENDIF()
ELSE()
FIND_LIBRARY(BOEHM_GC_LIBRARIES NAMES gc
HINTS ${PC_BDW_GC_LIBDIR} ${PC_BDW_GC_LIBRARY_DIRS})
# OpenSolaris uses bgc as Boehm GC runtime in its package manager.
# so try it
IF (NOT BOEHM_GC_LIBRARIES)
FIND_LIBRARY(BOEHM_GC_LIBRARIES NAMES bgc
HINTS ${PC_BDW_GC_LIBDIR} ${PC_BDW_GC_LIBRARY_DIRS})
ENDIF()
ENDIF()
MESSAGE(STATUS "Found GC library: ${BOEHM_GC_LIBRARIES}")
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Boehm_GC DEFAULT_MSG
BOEHM_GC_LIBRARIES BOEHM_GC_INCLUDE_DIR)
MARK_AS_ADVANCED(BOEHM_GC_LIBRARIES BOEHM_GC_INCLUDE_DIR)

View file

@ -1,326 +0,0 @@
#[[.rst
#
# FindGuile
# ---------
# Find the development libraries for Guile.
#
# Exported Vars
# ~~~~~~~~~~~~~
#
# .. variable:: Guile_FOUND
#
# Set to *true* if Guile was found.
#
# .. variable:: Guile_INCLUDE_DIRS
#
# A list of include directories.
#
# .. variable:: Guile_LIBRARIES
#
# A list of libraries needed to build you project.
#
# .. variable:: Guile_VERSION_STRING
#
# Guile full version.
#
# .. variable:: Guile_VERSION_MAJOR
#
# Guile major version.
#
# .. variable:: Guile_VERSION_MINOR
#
# Guile minor version.
#
# .. variable:: Guile_VERSION_PATCH
#
# Guile patch version.
#
# .. variable:: Guile_EXECUTABLE
#
# Guile executable (optional).
#
# .. variable:: Guile_CONFIG_EXECUTABLE
#
# Guile configuration executable (optional).
#
# .. variable:: Guile_ROOT_DIR
#
# Guile installation root dir (optional).
#
# .. variable:: Guile_SITE_DIR
#
# Guile installation module site dir (optional).
#
# .. variable:: Guile_EXTENSION_DIR
#
# Guile installation extension dir (optional).
#
# Control VARS
# ~~~~~~~~~~~~
# :envvar:`Guile_ROOT_DIR`
#
# Use this variable to provide hints to :filename:`find_{*}` commands,
# you may pass it to :command:`cmake` or set the environtment variable.
#
# .. code-block:: cmake
#
# % cmake . -Bbuild -DGuile_ROOT_DIR=<extra-path>
#
# # or
# % export Guile_ROOT_DIR=<extra-path>;
# % cmake . -Bbuild
#
# # or
# % Guile_ROOT_DIR=<extra-path> cmake . -Bbuild
#
#
#]]
#[[.rst
#
# Copyright © 2016, Edelcides Gonçalves <eatg75 |0x40| gmail>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# *THE SOFTWARE IS PROVIDED* **AS IS** *AND ISC DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE
# LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE*.
#
# This file is not part of CMake
#
#]]
include (SelectLibraryConfigurations)
include (FindPackageHandleStandardArgs)
function (_guile_find_component_include_dir component header)
find_path ("${component}_INCLUDE_DIR"
${header}
HINTS
"${GUile_ROOT_DIR}"
ENV Guile_ROOT_DIR
PATH_SUFFIXES
Guile guile Guile-2.0 guile-2.0 Guile/2.0 guile/2.0 GC
gc)
set ("${component}_INCLUDE_DIR" "${${component}_INCLUDE_DIR}"
PARENT_SCOPE)
endfunction ()
function (_guile_find_component_library component_name component)
find_library ("${component_name}_LIBRARY_RELEASE"
NAMES "${component}" "${component}-2.0"
HINTS
"${GUile_ROOT_DIR}"
ENV Guile_ROOT_DIR
PATHS
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/lib64/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/lib32/${CMAKE_LIBRARY_ARCHITECTURE})
if (${component_name}_LIBRARY_RELEASE)
select_library_configurations (${component_name})
set ("${component_name}_LIBRARY_RELEASE"
"${${component_name}_LIBRARY_RELEASE}" PARENT_SCOPE)
set ("${component_name}_LIBRARY"
"${${component_name}_LIBRARY}" PARENT_SCOPE)
set ("${component_name}_LIBRARIES"
"${${component_name}_LIBRARIES}" PARENT_SCOPE)
endif ()
endfunction ()
function (_guile_find_version_2 header_file macro_name)
file (STRINGS "${header_file}" _VERSION
REGEX "#define[\t ]+${macro_name}[\t ]+[0-9]+")
if (_VERSION)
string (REGEX REPLACE
".*#define[\t ]+${macro_name}[\t ]+([0-9]+).*"
"\\1" _VERSION_VALUE "${_VERSION}")
if ("${_VERSION}" STREQUAL "${_VERSION_VALUE}")
set (_VERSION_FOUND 0 PARENT_SCOPE)
else ()
set (_VERSION_FOUND 1 PARENT_SCOPE)
set (_VERSION "${_VERSION_VALUE}" PARENT_SCOPE)
endif ()
else ()
set (_VERSION_FOUND 0 PARENT_SCOPE)
endif ()
endfunction ()
##### Entry Point #####
set (Guile_FOUND)
set (Guile_INCLUDE_DIRS)
set (Guile_LIBRARIES)
set (Guile_VERSION_STRING)
set (Guile_VERSION_MAJOR)
set (Guile_VERSION_MINOR)
set (Guile_VERSION_PATCH)
set (Guile_EXECUTABLE)
_guile_find_component_include_dir (Guile "libguile.h")
if (Guile_INCLUDE_DIR)
_guile_find_version_2 ("${Guile_INCLUDE_DIR}/libguile/version.h"
SCM_MAJOR_VERSION)
if (_VERSION_FOUND)
set (Guile_VERSION_MAJOR "${_VERSION}")
else ()
message (FATAL_ERROR "FindGuile: Failed to find Guile_MAJOR_VERSION.")
endif ()
_guile_find_version_2 ("${Guile_INCLUDE_DIR}/libguile/version.h"
SCM_MINOR_VERSION)
if (_VERSION_FOUND)
set (Guile_VERSION_MINOR "${_VERSION}")
else ()
message (FATAL_ERROR "FindGuile: Failed to find Guile_MINOR_VERSION.")
endif ()
_guile_find_version_2 ("${Guile_INCLUDE_DIR}/libguile/version.h"
SCM_MICRO_VERSION)
if (_VERSION_FOUND)
set (Guile_VERSION_PATCH "${_VERSION}")
else ()
message (FATAL_ERROR "FindGuile: Failed to find Guile_MICRO_VERSION.")
endif ()
set (Guile_VERSION_STRING "${Guile_VERSION_MAJOR}.${Guile_VERSION_MINOR}.${Guile_VERSION_PATCH}")
unset (_VERSION_FOUND)
unset (_VERSION)
endif ()
_guile_find_component_include_dir (Guile_GC "gc.h")
_guile_find_component_library (Guile guile)
_guile_find_component_library (Guile_GC gc)
find_program (Guile_EXECUTABLE
guile
DOC "Guile executable.")
if (Guile_EXECUTABLE)
execute_process (COMMAND ${Guile_EXECUTABLE} --version
RESULT_VARIABLE _status
OUTPUT_VARIABLE _output
OUTPUT_STRIP_TRAILING_WHITESPACE)
string (REGEX REPLACE ".*\\(GNU Guile\\)[\t ]+([0-9]+)\\..*" "\\1"
_guile_ver_major "${_output}")
string (REGEX REPLACE ".*\\(GNU Guile\\)[\t ]+[0-9]+\\.([0-9]+).*" "\\1"
_guile_ver_minor "${_output}")
string (REGEX REPLACE ".*\\(GNU Guile\\)[\t ]+[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1"
_guile_ver_patch "${_output}")
set (_version "${_guile_ver_major}.${_guile_ver_minor}.${_guile_ver_patch}")
if (NOT Guile_FIND_QUIETLY)
if (NOT Guile_VERSION_STRING STREQUAL _version)
message (WARNING "FindGuile: Versions provided by library differs from the one provided by executable.")
endif ()
if (NOT _status STREQUAL "0")
message (WARNING "FindGuile: guile (1) process exited abnormally.")
endif ()
endif ()
unset (_version)
unset (_status)
unset (_version)
unset (_guile_ver_major)
unset (_guile_ver_minor)
unset (_guile_ver_patch)
endif ()
find_package_handle_standard_args (GC
"FindGuile: Failed to find dependency GC."
Guile_GC_INCLUDE_DIR
Guile_GC_LIBRARY
Guile_GC_LIBRARIES
Guile_GC_LIBRARY_RELEASE)
find_package_handle_standard_args (Guile
REQUIRED_VARS
Guile_INCLUDE_DIR
Guile_LIBRARY
Guile_LIBRARIES
Guile_LIBRARY_RELEASE
GC_FOUND
VERSION_VAR Guile_VERSION_STRING)
if (Guile_FOUND)
list (APPEND Guile_INCLUDE_DIRS "${Guile_INCLUDE_DIR}"
"${Guile_GC_INCLUDE_DIR}")
if (NOT TARGET Guile::Library AND NOT TARGET GC::Library)
add_library (Guile::GC::Library UNKNOWN IMPORTED)
set_property (TARGET Guile::GC::Library APPEND
PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties (Guile::GC::Library
PROPERTIES
INTERFACE_INCLUDE_DIRS
"${Guile_GC_INCLUDE_DIR}"
IMPORTED_LOCATION
"${Guile_GC_LIBRARY}"
IMPORTED_LOCATION_RELEASE
"${Guile_GC_LIBRARY_RELEASE}")
add_library (Guile::Library UNKNOWN IMPORTED)
set_property (TARGET Guile::Library APPEND
PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_property (TARGET Guile::Library APPEND
PROPERTY
INTERFACE_LINK_LIBRARIES
Guile::GC::Library)
set_target_properties (Guile::Library
PROPERTIES
INTERFACE_INCLUDE_DIRSr
"${Guile_INCLUDE_DIR}"
IMPORTED_LOCATION "${Guile_LIBRARY}"
IMPORTED_LOCATION_RELEASE
"${Guile_LIBRARY_RELEASE}")
set (Guile_LIBRARIES Guile::Library Guile::GC::Library)
endif ()
endif ()
find_program(Guile_CONFIG_EXECUTABLE
NAMES guile-config
DOC "Guile configutration binary")
if (Guile_CONFIG_EXECUTABLE)
execute_process (COMMAND ${Guile_CONFIG_EXECUTABLE} info prefix
OUTPUT_VARIABLE Guile_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND ${Guile_CONFIG_EXECUTABLE} info sitedir
OUTPUT_VARIABLE Guile_SITE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND ${Guile_CONFIG_EXECUTABLE} info extensiondir
OUTPUT_VARIABLE Guile_EXTENSION_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif ()
mark_as_advanced (Guile_EXECUTABLE
Guile_INCLUDE_DIR
Guile_LIBRARY
Guile_LIBRARY_RELEASE
Guile_GC_INCLUDE_DIR
Guile_GC_LIBRARY
Guile_GC_LIBRARY_RELEASE)

View file

@ -1,15 +0,0 @@
# - Try to find c-rrb
# Once done, this will define
#
# RRB_FOUND - system has RRB
# RRB_INCLUDE_DIR - the RRB include directories
# RRB_LIBRARIES - link these to use RRB
find_path(RRB_INCLUDE_DIR rrb.h)
find_library(RRB_LIBRARIES NAMES rrb librrb)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
RRB DEFAULT_MSG RRB_LIBRARIES RRB_INCLUDE_DIR)
mark_as_advanced(RRB_INCLUDE_DIR RRB_LIBRARIES)

View file

@ -1,24 +0,0 @@
function(immer_target_name_for out_target out_file file)
get_filename_component(_extension ${_file} EXT)
file(RELATIVE_PATH _relative ${PROJECT_SOURCE_DIR} ${file})
string(REPLACE "${_extension}" "" _name ${_relative})
string(REGEX REPLACE "/" "-" _name ${_name})
set(${out_target} "${_name}" PARENT_SCOPE)
file(RELATIVE_PATH _relative ${CMAKE_CURRENT_LIST_DIR} ${file})
string(REPLACE "${_extension}" "" _name ${_relative})
string(REGEX REPLACE "/" "-" _name ${_name})
set(${out_file} "${_name}" PARENT_SCOPE)
endfunction()
function(immer_canonicalize_cmake_booleans)
foreach(var ${ARGN})
if(${var})
set(${var} 1 PARENT_SCOPE)
else()
set(${var} 0 PARENT_SCOPE)
endif()
endforeach()
endfunction()

View file

@ -1,2 +0,0 @@
ignore:
- tools

View file

@ -1,14 +0,0 @@
{ pkgs, lib, ... }:
pkgs.llvmPackages.libcxxStdenv.mkDerivation rec {
name = "immer-git";
version = "git";
src = ./.;
nativeBuildInputs = [ pkgs.cmake ];
dontBuild = true;
meta = with lib; {
homepage = "https://github.com/arximboldi/immer";
description = "Postmodern immutable data structures for C++";
license = licenses.boost;
};
}

View file

@ -1,23 +0,0 @@
# Targets
# =======
add_custom_target(doxygen
COMMAND doxygen doxygen.config
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/doc")
add_custom_target(docs
COMMAND make html
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/doc")
add_dependencies(docs doxygen)
set(immer_ssh_method
ssh -p 5488
-o StrictHostKeyChecking=no
-i ${CMAKE_SOURCE_DIR}/tools/travis/ssh-key)
add_custom_target(upload-docs
COMMAND
rsync -av -e \"${immer_ssh_method}\"
${CMAKE_SOURCE_DIR}/doc/_build/html/*
raskolnikov@sinusoid.es:public/immer/)

View file

@ -1,226 +0,0 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources"
.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*
.PHONY: html
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
bash sphinx-html-hack.bash
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: dirhtml
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: singlehtml
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
.PHONY: pickle
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
.PHONY: json
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
.PHONY: htmlhelp
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
.PHONY: qthelp
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/immer.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/immer.qhc"
.PHONY: applehelp
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."
.PHONY: devhelp
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/immer"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/immer"
@echo "# devhelp"
.PHONY: epub
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
.PHONY: epub3
epub3:
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
@echo
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
.PHONY: latex
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
.PHONY: latexpdf
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: latexpdfja
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: text
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
.PHONY: man
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
.PHONY: texinfo
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
.PHONY: info
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
.PHONY: gettext
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
.PHONY: changes
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
.PHONY: linkcheck
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
.PHONY: doctest
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
.PHONY: coverage
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
.PHONY: xml
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
.PHONY: pseudoxml
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
.PHONY: dummy
dummy:
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
@echo
@echo "Build finished. Dummy builder generates no files."

View file

@ -1,100 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="437.76035"
height="141.89464"
viewBox="0 0 115.8241 37.542956"
version="1.1"
id="svg5447"
inkscape:version="0.92.1 r15371"
sodipodi:docname="logo-black.svg">
<defs
id="defs5441" />
<sodipodi:namedview
id="base"
pagecolor="#000000"
bordercolor="#8b8384"
borderopacity="1"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="335.15011"
inkscape:cy="98.353481"
inkscape:document-units="mm"
inkscape:current-layer="g4502"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1152"
inkscape:window-height="1080"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="0"
units="px" />
<metadata
id="metadata5444">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(6.8182189,-70.341619)">
<g
id="g4502"
transform="matrix(0.45286986,0,0,0.45286986,18.570763,48.756461)">
<g
id="g5321"
transform="matrix(0.28222223,0,0,0.28222223,263.62161,572.00923)"
style="fill:none;stroke:#ffffff">
<g
style="fill:none;stroke:#ffffff;stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none"
transform="translate(303.46093,-4.9296877)"
id="g5317">
<path
id="rect5315"
style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m -1334.1996,-1796.9898 h 179.7406 v 179.7405 h -179.7406 z m -92,0 h 179.7406 v 179.7405 h -179.7406 z m 46,48 h 179.7406 v 179.7405 h -179.7406 z m 0,-94 h 179.7406 v 179.7405 h -179.7406 z m 0,48 h 179.7406 v 179.7405 h -179.7406 z"
inkscape:connector-curvature="0" />
</g>
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:900;font-stretch:normal;font-size:3.62277412px;line-height:0%;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro Heavy';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.30189785px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="43.067963"
y="112.13454"
id="text5338"><tspan
sodipodi:role="line"
id="tspan5336"
x="43.067963"
y="112.13454"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:53.88218689px;line-height:1.25;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro Bold';fill:#ffffff;stroke-width:0.30189785px">immer</tspan></text>
<rect
ry="0"
y="66.38237"
x="-37.756119"
height="7.9375"
width="7.9375"
id="rect5425"
style="opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:3.35253906;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.9 KiB

View file

@ -1,99 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1037.7604"
height="441.89462"
viewBox="0 0 274.57411 116.91795"
version="1.1"
id="svg5447"
inkscape:version="0.92.1 r15371"
sodipodi:docname="logo-front.svg">
<defs
id="defs5441" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="172.29297"
inkscape:cy="385.49612"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="150"
fit-margin-left="300"
fit-margin-right="300"
fit-margin-bottom="150"
inkscape:window-width="1440"
inkscape:window-height="1080"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="0"
units="px" />
<metadata
id="metadata5444">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(86.193219,-30.654119)">
<g
id="g4502"
transform="matrix(0.45286986,0,0,0.45286986,18.570763,48.756461)">
<g
id="g5321"
transform="matrix(0.28222223,0,0,0.28222223,263.62161,572.00923)">
<g
style="stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none"
transform="translate(303.46093,-4.9296877)"
id="g5317">
<path
id="rect5315"
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m -1334.1996,-1796.9898 h 179.7406 v 179.7405 h -179.7406 z m -92,0 h 179.7406 v 179.7405 h -179.7406 z m 46,48 h 179.7406 v 179.7405 h -179.7406 z m 0,-94 h 179.7406 v 179.7405 h -179.7406 z m 0,48 h 179.7406 v 179.7405 h -179.7406 z"
inkscape:connector-curvature="0" />
</g>
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:900;font-stretch:normal;font-size:3.62277412px;line-height:0%;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro Heavy';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.30189785px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="43.067963"
y="112.13454"
id="text5338"><tspan
sodipodi:role="line"
id="tspan5336"
x="43.067963"
y="112.13454"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:53.88218689px;line-height:1.25;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro Bold';stroke-width:0.30189785px">immer</tspan></text>
<rect
ry="0"
y="66.38237"
x="-37.756119"
height="7.9375"
width="7.9375"
id="rect5425"
style="opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:3.35253906;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -1,99 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="437.76035"
height="141.89464"
viewBox="0 0 115.8241 37.542956"
version="1.1"
id="svg5447"
inkscape:version="0.92.1 r15371"
sodipodi:docname="logo.svg">
<defs
id="defs5441" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="-127.70703"
inkscape:cy="235.49612"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1440"
inkscape:window-height="1080"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="0"
units="px" />
<metadata
id="metadata5444">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(6.8182189,-70.341619)">
<g
id="g4502"
transform="matrix(0.45286986,0,0,0.45286986,18.570763,48.756461)">
<g
id="g5321"
transform="matrix(0.28222223,0,0,0.28222223,263.62161,572.00923)">
<g
style="stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none"
transform="translate(303.46093,-4.9296877)"
id="g5317">
<path
id="rect5315"
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:20;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m -1334.1996,-1796.9898 h 179.7406 v 179.7405 h -179.7406 z m -92,0 h 179.7406 v 179.7405 h -179.7406 z m 46,48 h 179.7406 v 179.7405 h -179.7406 z m 0,-94 h 179.7406 v 179.7405 h -179.7406 z m 0,48 h 179.7406 v 179.7405 h -179.7406 z"
inkscape:connector-curvature="0" />
</g>
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:900;font-stretch:normal;font-size:3.62277412px;line-height:0%;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro Heavy';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.30189785px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="43.067963"
y="112.13454"
id="text5338"><tspan
sodipodi:role="line"
id="tspan5336"
x="43.067963"
y="112.13454"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:53.88218689px;line-height:1.25;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro Bold';stroke-width:0.30189785px">immer</tspan></text>
<rect
ry="0"
y="66.38237"
x="-37.756119"
height="7.9375"
width="7.9375"
id="rect5425"
style="opacity:1;vector-effect:none;fill:#ff0000;fill-opacity:1;stroke:none;stroke-width:3.35253906;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 175.20599 88.309158"
xml:space="preserve"
sodipodi:docname="patreon.svg"
inkscape:version="0.92.2pre0 (973e216, 2017-07-25)"
width="175.20599"
height="88.309158"><metadata
id="metadata53"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>support</dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs51" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1267"
inkscape:window-height="1054"
id="namedview49"
showgrid="false"
inkscape:zoom="1.672"
inkscape:cx="-2.5899259"
inkscape:cy="100.34184"
inkscape:window-x="0"
inkscape:window-y="26"
inkscape:window-maximized="0"
inkscape:current-layer="Layer_1"
fit-margin-left="16"
fit-margin-right="16"
fit-margin-bottom="16"
fit-margin-top="16"
showborder="true" /><style
type="text/css"
id="style2">
.st0{fill:#E64825;}
.st1{fill:#FFFFFF;}
.st2{enable-background:new ;}
</style><title
id="title4">support</title><g
id="g4591"
transform="matrix(1.1623322,0,0,1.1623322,4.376678,-18.86997)"><rect
ry="5.3968496"
y="30.000004"
x="10"
height="48.444977"
width="123.20574"
id="rect4576"
style="opacity:1;vector-effect:none;fill:#f96854;fill-opacity:1;stroke:none;stroke-width:1.95915079;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /><g
transform="translate(9.401915,29.145936)"
id="g4574"><g
id="g4557"
transform="translate(-120.21531,7.9502949)"><path
id="path8"
d="m 143.8,12.9 h 0.7 c 6.4,0.2 11.5,5.6 11.3,12 -0.2,6.2 -5.1,11.1 -11.3,11.3 h -5.7 c 0,-3.9 0,-7.8 0,-11.7 0.1,-2.9 2.5,-5.3 5.4,-5.2 2.9,0.1 5.3,2.5 5.2,5.4 -0.1,2.9 -2.5,5.3 -5.4,5.2 -0.8,0 -1.7,-0.2 -2.4,-0.6 0,1.3 0,2.5 0,3.8 1.7,0.5 3.6,0.5 5.3,-0.1 4.7,-1.5 7.2,-6.6 5.6,-11.2 -1.5,-4.7 -6.6,-7.2 -11.2,-5.6 -3.6,1.2 -6,4.5 -6.1,8.3 0,3.9 0,7.8 0,11.7 h -2.8 v -12 c 0.1,-4 2.3,-7.6 5.6,-9.6 1.9,-1.1 3.8,-1.7 5.8,-1.7 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
id="path10"
d="m 186.5,13.9 h 1.9 c 0,1.4 0,2.9 0,4.3 h 2.8 c 0,0.6 0,1.3 0,1.9 h -2.8 c 0,3.1 0,6.2 0,9.3 h -1.9 c 0,-3.1 0,-6.2 0,-9.3 h -1.1 c 0,-0.6 0,-1.3 0,-1.9 h 1.1 c 0,-1.4 -0.1,-2.9 0,-4.3 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
id="path12"
d="m 177.5,17.8 c 3.3,-0.7 6.5,1.5 7.2,4.8 0,0.1 0,0.2 0,0.2 0.1,0.6 0.1,1.2 0.1,1.8 0,1.6 0,3.2 0,4.8 h -1.9 c 0,-0.4 0,-0.8 0,-1.2 -2.4,2.3 -6.3,2.2 -8.6,-0.2 -2.3,-2.4 -2.2,-6.3 0.2,-8.6 0.8,-0.9 1.9,-1.4 3,-1.6 z m 0.8,1.7 c -2.3,0.2 -4,2.3 -3.8,4.6 0,0.3 0.1,0.5 0.2,0.8 0.2,0.8 0.7,1.5 1.3,2 0.7,0.6 1.6,1 2.6,1 0.8,0 1.6,-0.1 2.3,-0.5 2,-1.2 2.7,-3.7 1.6,-5.8 -1,-1.4 -2.5,-2.2 -4.2,-2.1 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
id="path14"
d="m 203.3,17.7 c 2,-0.3 4,0.5 5.3,1.9 l -7.9,6.6 c 1.4,1.9 4,2.3 5.9,0.9 1.3,-0.9 1.9,-2.5 1.7,-4 h 1.9 c 0.1,1.3 -0.2,2.6 -0.9,3.8 -0.5,0.9 -1.2,1.6 -2.1,2.1 -2.9,1.7 -6.6,0.8 -8.4,-2.1 -0.7,-1.1 -1,-2.4 -0.9,-3.6 0.1,-1 0.4,-2 1,-2.8 1.1,-1.5 2.6,-2.5 4.4,-2.8 z m -2.8,3.8 c -0.6,0.9 -0.8,2 -0.6,3 l 5.6,-4.7 c -0.3,-0.1 -0.7,-0.2 -1,-0.2 -1.6,-0.2 -3.1,0.6 -4,1.9 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
id="path16"
d="m 216.6,17.7 c 1.3,-0.1 2.6,0.2 3.6,0.9 2.9,1.8 3.7,5.5 1.9,8.4 -1.8,2.9 -5.5,3.7 -8.4,1.9 -2.9,-1.8 -3.7,-5.5 -1.9,-8.4 0.5,-0.8 1.2,-1.5 2,-2 0.9,-0.5 1.8,-0.8 2.8,-0.8 z m 0.1,1.8 c -2.3,0.2 -4.1,2.2 -3.9,4.5 0.2,2.3 2.2,4.1 4.5,3.9 2.3,-0.2 4.1,-2.2 3.9,-4.5 -0.1,-1.2 -0.7,-2.4 -1.7,-3.1 -0.8,-0.6 -1.8,-0.8 -2.8,-0.8 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
id="path18"
d="m 226,18.9 c 1.2,-1.1 2.8,-1.5 4.3,-1.1 1.2,0.3 2.2,1 2.9,1.9 0.6,0.8 1,1.8 1,2.8 0,1.5 0,3 0,4.6 v 2.2 h -1.9 c 0,-2.2 0,-4.5 0,-6.7 0,-1.1 -0.6,-2.1 -1.5,-2.6 -0.8,-0.5 -1.8,-0.6 -2.7,-0.3 -1.1,0.4 -1.9,1.5 -2.1,2.7 0,0.5 0,1 0,1.6 0,1.8 0,3.6 0,5.4 h -1.9 c 0,-3.7 0,-7.4 0,-11.1 h 1.9 c 0,0.1 0,0.3 0,0.6 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
id="path20"
d="m 161.1,20 c 2.1,-2.6 5.9,-3.1 8.6,-1 2.6,2.1 3.1,5.9 1,8.6 -1.1,1.3 -2.6,2.2 -4.3,2.3 -1,0.1 -2,-0.1 -2.8,-0.6 -0.7,-0.3 -1.3,-0.8 -1.8,-1.3 0,1.9 0,3.8 0,5.7 h -1.9 c 0,-3.3 0,-6.6 0,-9.9 -0.1,-1.4 0.4,-2.7 1.2,-3.8 z m 4,-0.4 c -2.3,0.4 -3.8,2.6 -3.4,4.9 0.4,2.3 2.6,3.8 4.9,3.4 2.3,-0.4 3.8,-2.6 3.4,-4.9 -0.2,-1.2 -1,-2.3 -2,-2.9 -0.9,-0.5 -1.9,-0.7 -2.9,-0.5 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#ffffff" /><path
id="path22"
d="m 192,18.2 h 1.8 c 0,0.6 0,1.1 0,1.7 1.2,-1.1 2.8,-1.8 4.4,-1.7 0,0.6 0,1.3 0,1.9 -2.3,-0.1 -4.3,1.7 -4.4,4.1 0,0 0,0.1 0,0.1 0,1.7 0,3.4 0,5.1 H 192 c 0.1,-3.8 0,-7.5 0,-11.2 z"
class="st1"
inkscape:connector-curvature="0"
style="fill:#ffffff" /></g><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.8520174px;line-height:4.5em;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro';text-align:end;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.73991024"
x="114.89897"
y="14.870183"
id="text4561"><tspan
sodipodi:role="line"
id="tspan4559"
x="114.89897"
y="14.870183"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro';fill:#ffffff;stroke-width:0.73991024">support us on</tspan></text>
</g></g></svg>

Before

Width:  |  Height:  |  Size: 6.9 KiB

View file

@ -1,166 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="350"
height="20"
version="1.1"
id="svg28"
sodipodi:docname="sinusoidal-badge.svg"
inkscape:version="0.92.2pre0 (973e216, 2017-07-25)">
<metadata
id="metadata34">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs32">
<marker
inkscape:isstock="true"
style="overflow:visible"
id="Arrow1Lstart"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Lstart">
<path
inkscape:connector-curvature="0"
transform="matrix(0.8,0,0,0.8,10,0)"
style="fill:#444444;fill-opacity:1;fill-rule:evenodd;stroke:#444444;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path10186" />
</marker>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1267"
inkscape:window-height="1054"
id="namedview30"
showgrid="false"
inkscape:zoom="1"
inkscape:cx="89.411561"
inkscape:cy="-177.54677"
inkscape:window-x="0"
inkscape:window-y="26"
inkscape:window-maximized="0"
inkscape:current-layer="g26" />
<linearGradient
id="b"
x2="0"
y2="1">
<stop
offset="0"
stop-color="#bbb"
stop-opacity=".1"
id="stop2" />
<stop
offset="1"
stop-opacity=".1"
id="stop4" />
</linearGradient>
<mask
id="a">
<rect
width="96"
height="20"
rx="3"
id="rect7"
x="0"
y="0"
style="fill:#ffffff" />
</mask>
<g
font-size="11"
id="g26"
style="font-size:11px;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;text-anchor:middle;fill:#000000">
<text
x="30"
y="15"
id="text18"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro';fill:#000000;fill-opacity:0.3" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:14.66666698px;line-height:4.5em;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro';text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
x="52.626465"
y="14.072"
id="text843"><tspan
sodipodi:role="line"
id="tspan841"
x="52.626465"
y="14.072"
style="font-size:13.33333397px"><tspan
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:13.33333397px;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro Light'"
id="tspan859">quality libre software by</tspan><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:13.33333397px;font-family:'Source Sans Pro';-inkscape-font-specification:'Source Sans Pro Bold'"
id="tspan4711"> </tspan><tspan
style="font-weight:bold;font-size:13.33333397px"
id="tspan849">sinusoidal engineering</tspan></tspan></text>
<g
transform="matrix(4.4383113,0,0,4.4383113,-73.95876,-379.69787)"
id="layer1"
inkscape:label="Layer 1">
<g
id="g10518"
transform="matrix(0.07290361,0,0,0.07290361,90.22887,85.474692)">
<g
id="g906"
transform="matrix(0.8913912,0,0,0.8913912,6.4029255,3.518587)">
<g
transform="translate(2.9886077,2.3730299)"
style="stroke-width:6;stroke-miterlimit:4;stroke-dasharray:none"
id="g10505">
<g
transform="matrix(0.28222223,0,0,0.28222223,237.85811,-1729.1481)"
style="stroke:#444444;stroke-width:32.14861298;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="g6292">
<rect
y="6129.2646"
x="-842.80432"
height="206.24994"
width="206.25005"
id="rect6290"
style="opacity:1;fill:none;fill-opacity:1;stroke:#444444;stroke-width:32.14861298;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
<path
id="path6294"
title="sin(x/2)"
d="m 55.5625,0.66666667 c -0.928371,0 -1.856705,0.13319437 -2.785079,0.39715343 -0.928371,0.2636873 -1.856744,0.6592201 -2.785077,1.1798418 -0.928372,0.5208916 -1.856743,1.1674139 -2.785116,1.9309205 -0.928334,0.7632369 -1.856705,1.6439988 -2.785078,2.6290465 -0.928372,0.9850477 -1.856743,2.0754629 -2.785077,3.2555751 -0.928372,1.180112 -1.856744,2.450461 -2.785115,3.793218 -0.928336,1.342755 -1.856706,2.758458 -2.785077,4.227385 -0.928374,1.469197 -1.856708,2.991617 -2.785079,4.546459 -0.928372,1.555111 -1.856744,3.142642 -2.785115,4.741252 -0.928334,1.598609 -1.856707,3.208295 -2.785078,4.806905 -0.928371,1.598608 -1.856705,3.18614 -2.785079,4.741251 -0.928371,1.555112 -1.856705,3.077263 -2.785077,4.546188 -0.928408,1.469197 -1.856743,2.88463 -2.785079,4.227655 -0.928407,1.342757 -1.856742,2.612837 -2.785115,3.793218 -0.928334,1.180113 -1.856705,2.270258 -2.785077,3.255575 -0.928372,0.985319 -1.856742,1.86554 -2.785113,2.629047 -0.928337,0.763506 -1.8567441,1.409758 -2.785079,1.93092 C 7.2876175,57.819171 6.3592466,58.214164 5.4308755,58.478121 4.5025393,58.742347 3.5742044,58.875 2.6458333,58.875"
style="opacity:1;fill:none;fill-opacity:1;stroke:#444444;stroke-width:9.07305336;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
inkscape:connector-curvature="0" />
</g>
<circle
r="7.2447839"
cy="2.9294415"
cx="61.518147"
id="ellipse10510"
style="opacity:1;fill:#f0544c;fill-opacity:1;stroke:#ffffff;stroke-width:5.44383192;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<circle
style="opacity:1;fill:#444444;fill-opacity:1;stroke:#ffffff;stroke-width:5.44383192;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="circle898"
cx="2.0896502"
cy="61.450638"
r="7.2447839" />
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 7.1 KiB

View file

@ -1,28 +0,0 @@
Algorithms
==========
This module provides overloads of standard algorithms that leverage
the internal structure of the immutable containers to provide faster
iteration. These are drop-in replacements of the respective STL
algorithms that can be a few times faster when applied on immutable
sequences.
For further convenience they can be passed in just a container where
the standard library algorithms require being passed in two iterators.
.. note::
They are a similar idea to `structure-aware iterators`_
but implemented using higher order functions in order to support
structures of any depth. The downside is that this sometimes
causes the compiler to generate bigger executable files.
.. _structure-aware iterators: https://www.youtube.com/watch?v=T3oA3zAMH9M
-----
.. doxygengroup:: algorithm
:project: immer
:content-only:

View file

@ -1,452 +0,0 @@
# -*- coding: utf-8 -*-
#
# immer documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 27 18:10:24 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.mathjax',
'breathe',
]
breathe_projects = { "immer": "_doxygen/xml" }
breathe_default_project = "immer"
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify
source_parsers = { '.md': CommonMarkParser, }
source_suffix = ['.rst', '.md']
def setup(app):
app.add_config_value('recommonmark_config', {
'enable_eval_rst': True,
}, True)
app.add_transform(AutoStructify)
# The encoding of source files.
#
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'immer'
copyright = u'2016, 2017 Juan Pedro Bolivar Puente'
author = u'Juan Pedro Bolivar Puente'
raw_enabled = True
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'0.0.0'
# The full version, including alpha/beta/rc tags.
release = u'0.0.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#
# today = ''
#
# Else, today_fmt is used as the format for a strftime call.
#
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
import sys
import os.path
sys.path.append(os.path.join(os.path.dirname(__file__),
'../tools/sinusoidal-sphinx-theme'))
import sinusoidal_sphinx_theme
html_theme_path = sinusoidal_sphinx_theme.html_theme_path()
html_theme = 'sinusoidal_sphinx_theme'
extensions.append("sinusoidal_sphinx_theme")
html_theme_options = {
"project_nav_name": "immer",
"github_link" : "https://github.com/arximboldi/immer",
}
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = u'immer v0.0.0'
# A shorter title for the navigation bar. Default is the same as html_title.
#
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#
html_logo = '_static/logo-black.svg'
# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#
# html_extra_path = []
# If not None, a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
# The empty string is equivalent to '%b %d, %Y'.
#
# html_last_updated_fmt = None
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#
# html_additional_pages = {}
# If false, no module index is generated.
#
# html_domain_indices = True
# If false, no index is generated.
#
# html_use_index = True
# If true, the index is split into individual pages for each letter.
#
# html_split_index = False
# If true, links to the reST sources are added to the pages.
#
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
#
# html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# 'ja' uses this config value.
# 'zh' user can custom change `jieba` dictionary path.
#
# html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#
# html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'immerdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'immer.tex', u'immer Documentation',
u'Juan Pedro Bolivar Puente', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#
# latex_use_parts = False
# If true, show page references after internal links.
#
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
#
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
#
# latex_appendices = []
# It false, will not define \strong, \code, itleref, \crossref ... but only
# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
# packages.
#
# latex_keep_old_macro_names = True
# If false, no module index is generated.
#
# latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'immer', u'immer Documentation',
[author], 1)
]
# If true, show URL addresses after external links.
#
# man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'immer', u'immer Documentation',
author, 'immer', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#
# texinfo_appendices = []
# If false, no module index is generated.
#
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#
# texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#
# texinfo_no_detailmenu = False
# -- Options for Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = copyright
# The basename for the epub file. It defaults to the project name.
# epub_basename = project
# The HTML theme for the epub output. Since the default themes are not
# optimized for small screen space, using the same theme for HTML and epub
# output is usually not wise. This defaults to 'epub', a theme designed to save
# visual space.
#
# epub_theme = 'epub'
# The language of the text. It defaults to the language option
# or 'en' if the language is not set.
#
# epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
# epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# A unique identification for the text.
#
# epub_uid = ''
# A tuple containing the cover image and cover page html template filenames.
#
# epub_cover = ()
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
#
# epub_guide = ()
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#
# epub_pre_files = []
# HTML files that should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#
# epub_post_files = []
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# The depth of the table of contents in toc.ncx.
#
# epub_tocdepth = 3
# Allow duplicate toc entries.
#
# epub_tocdup = True
# Choose between 'default' and 'includehidden'.
#
# epub_tocscope = 'default'
# Fix unsupported image types using the Pillow.
#
# epub_fix_images = False
# Scale large images.
#
# epub_max_image_width = 0
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#
# epub_show_urls = 'inline'
# If false, no index is generated.
#
# epub_use_index = True

View file

@ -1,50 +0,0 @@
.. highlight:: c++
Containers
==========
This section describes all the containers provided by the library.
Check the :ref:`design` section for a general discussion of these
containers and how to use them.
box
---
.. doxygenclass:: immer::box
:members:
:undoc-members:
array
-----
.. doxygenclass:: immer::array
:members:
:undoc-members:
vector
------
.. doxygenclass:: immer::vector
:members:
:undoc-members:
flex_vector
-----------
.. doxygenclass:: immer::flex_vector
:members:
:undoc-members:
set
---
.. doxygenclass:: immer::set
:members:
:undoc-members:
map
---
.. doxygenclass:: immer::map
:members:
:undoc-members:

View file

@ -1,268 +0,0 @@
.. _design:
Design
======
This is a library of **immutable containers**.
These containers have all their methods marked ``const``. Instead of
mutating them *in place*, they provide manipulation functions that
*return a new transformed value*, leaving the original value
unaltered. In the context of data-structures, this property of
preserving old values is called **persistence**.
Most of these containers use data-structures in which these operations
can be done *efficiently*. In particular, not all data is copied when
a new value is produced. Instead, the new values may share,
internally, common data with other objects. We sometimes refer to
this property as **structural sharing**. This behaviour is
transparent to the user.
Assigment
---------
We are sorry, we lied. These containers provide *one mutating
operation*: **assignment** --- i.e. ``operator=``.
There is a good reason: without ``operator=`` everything becomes
complicated in C++. For example, one may not contain non-assignable
types in many standard containers, assignment would also be disabled
from your custom types holding immutable containers, and so on and so
forth.
C++ is a multi-paradigm language with an imperative core. Thus, it is
built on the foundation that *variables* can be mutated ---
i.e. assigned to. We don't want to ride against this tide. What we
want to prevent is in-place *object* manipulation. Because of C++
semantics, *variable* assignment is defined in terms of *object
mutation*, so we have to provide *this very particular mutating
operation*, but nothing else. Of course, you are free to mark your
variables ``const`` to completely forbid assignment.
.. warning::
**Assignment is not thread safe**. When a *mutable* variable is
shared across multiple threads, protect access using some other
mechanism.
For obvious reasons, all other methods, which are ``const``, are
thread-safe. It is safe to share *immutable* state across multiple
threads.
To ``const`` or not to ``const``
--------------------------------
Many C++ programmers, influenced by functional programming, are trying
to escape the evils of mutability by using ``const`` whenever
possible. We also do it ourselves in many of our examples to
reinforce the property of immutability.
While in general this is a good practice backed up with very good
intentions, it has one caveat: *it disables moveability*. It does so
even when ``std::move()`` is used. This makes sense, since moving from
an object may mutate it, and ``const``, my friends, prevents *all*
mutations. For example:
.. literalinclude:: ../example/vector/move.cpp
:language: c++
:start-after: move-bad/start
:end-before: move-bad/end
One may think that the variable ``v`` is moved into the
``push_back()`` call. This is not the case, because the variable
``v`` is marked ``const``. Of course, one may enable the move by
removing it, as in:
.. literalinclude:: ../example/vector/move.cpp
:language: c++
:start-after: move-good/start
:end-before: move-good/end
So, is it bad style then to use ``const`` as much as possible? I
wouldn't say so and it is advisable when ``std::move()`` is not used.
An alternative style is to not use ``const`` but adopt an `AAA-style
<aaa>`_ (*Almost Always use Auto*). This way, it is easy to look for
mutations by looking for lines that contain ``=`` but no ``auto``.
Remember that when using our immutable containers ``operator=`` is the
only way to mutate a variable.
.. _aaa: https://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/
.. admonition:: Why does ``const`` prevent move semantics?
For those adventurous into the grainy details C++, here is why.
``std::move()`` does not move anything, it is just *a cast* from
normal *l-value* references (``T&``) to *r-value* reference
(``T&&``). This is, you pass it a variable, and it returns a
reference to its object disguised as an intermediate result. In
exchange, you promise not to do anything with this variable later
[#f1]_. It is the role of the thing that *receives the moved-from
value* (in the previous example, ``push_back``) to actually do
anything interesting with it --- for example, steal its contents
😈.
So if you pass a ``T&`` to ``std::move()`` you get a ``T&&`` and,
unsurprisingly, if you pass a ``const T&`` you get a ``const T&&``.
But the receivers of the moved-from value (like constructors or our
``push_back()``) maybe be moved-into because they provide an
overload that expects ``T&&`` --- without the ``const``! Since a
``const T&&`` can not be converted into a ``T&&``, the compiler
looks up for you another viable overload, and most often finds a
copy constructor or something alike that expects a ``const T&`` or
just ``T``, to which a ``const T&&`` can be converted. The code
compiles and works correctly, but it is less efficient than we
expected. Our call to ``std::move()`` was fruitless.
.. [#f1] For the sake of completeness: it is actually allowed to do stuff
with the variable *after another value is assigned to it*.
.. _move-semantics:
Leveraging move semantics
-------------------------
When using :ref:`reference counting<rc>` (which is the default)
mutating operations can often be faster when operating on *r-value
references* (temporaries and moved-from values). Note that this
removes *persistence*, since one can not access the moved-from value
anymore! However, this may be a good idea when doing a chain of
operations where the intermediate values are not important to us.
For example, let's say we want to write a function that inserts all
integers in the range :math:`[first, last)` into an immutable vector.
From the point of view of the caller of the function, this function is
a *transaction*. Whatever intermediate vectors are generated inside
of it can be discarded since the caller can only see the initial
vector (the one passed in as argument) and the vector with *all* the
elements. We may write such function like this:
.. literalinclude:: ../example/vector/iota-move.cpp
:language: c++
:start-after: myiota/start
:end-before: myiota/end
The intermediate values are *moved* into the next ``push_back()``
call. They are going to be discarded anyways, this little
``std::move`` just makes the whole thing faster, letting ``push_back``
mutate part of the internal data structure in place when possible.
If you don't like this syntax, :doc:`transients<transients>` may be
used to obtain similar performance benefits.
.. admonition:: Assigment guarantees
From the language point of view, the only requirement on moved from
values is that they should still be destructible. We provide the
following two additional guarantees:
- **It is valid to assign to a moved-from variable**. The variable
gets the assigned value and becomes usable again. This is the
behaviour of standard types.
- **It is valid to assign a moved-from variable to itself**. For
most standard types this is *undefined behaviour*. However, for our
immutable containers types, expressions of the form ``v =
std::move(v)`` are well-defined.
Recursive types
---------------
Most containers will fail to be instantiated with a type of unknown
size, this is, an *incomplete type*. This prevents using them for
building recursive types. The following code fails to compile:
.. code-block:: c++
struct my_type
{
int data;
immer::vector<my_type> children;
};
However, we can easily workaround this by using an ``immer::box`` to wrap
the elements in the vector, as in:
.. code-block:: c++
struct my_type
{
int data;
immer::vector<immer::box<my_type>> children;
};
.. admonition:: Standard containers and incomplete types
While the first example might seem to compile when using some
implementations of ``std::vector`` instead of ``immer::vector``, such
use is actually forbidden by the standard:
**17.6.4.8** *Other functions (...)* 2. the effects are undefined in
the following cases: (...) In particular---if an incomplete type (3.9)
is used as a template argument when instantiating a template
component, unless specifically allowed for that component.
.. _batch-update:
Efficient batch manipulations
-----------------------------
Sometimes you may write a function that needs to do multiple changes
to a container. Like most code you write with this library, this
function is *pure*: it takes one container value in, and produces a
new container value out, no side-effects.
Let's say we want to write a function that inserts all integers in the
range :math:`[first, last)` into an immutable vector:
.. literalinclude:: ../example/vector/iota-slow.cpp
:language: c++
:start-after: include:myiota/start
:end-before: include:myiota/end
This function works as expected, but it is slower than necessary.
On every loop iteration, a new value is produced, just to be
forgotten in the next iteration.
Instead, we can grab a mutable view on the value, a :ref:`transient`.
Then, we manipulate it *in-place*. When we are done with it, we
extract back an immutable value from it. The code now looks like
this:
.. _iota-transient:
.. literalinclude:: ../example/vector/iota-transient.cpp
:language: c++
:start-after: include:myiota/start
:end-before: include:myiota/end
Both conversions are :math:`O(1)`. Note that calling ``transient()``
does not break the immutability of the variable it is called on. The
new mutable object will adopt its contents, but when a mutation is
performed, it will copy the data necessary using *copy on write*.
Subsequent manipulations may hit parts that have already been copied,
and these changes are done in-place. Because of this, it does not
make sense to use transients to do only one change.
.. tip::
Note that :ref:`move semantics<move-semantics>` can be used instead to
support a similar use-case. However, transients optimise updates
even when reference counting is disabled.
.. _std-compat:
Standard library compatibility
------------------------------
While the immutable containers provide an interface that follows a
functional style, this is incompatible with what the standard library
algorithms sometimes expect. :ref:`transients` try to provide an
interface as similar as possible to similar standard library
containers. Thus, can also be used to interoperate with standard
library components.
For example the :ref:`myiota() function above<iota-transient>` may as
well be written using standard library tools:
.. literalinclude:: ../example/vector/iota-transient-std.cpp
:language: c++
:start-after: include:myiota/start
:end-before: include:myiota/end

View file

@ -1,23 +0,0 @@
PROJECT_NAME = "immer"
OUTPUT_DIRECTORY = _doxygen
GENERATE_LATEX = NO
GENERATE_MAN = NO
GENERATE_RTF = NO
GENERATE_HTML = NO
GENERATE_XML = YES
INPUT = \
../immer \
../immer/heap \
../immer/refcount \
../immer/transience
INCLUDE_PATH = ..
QUIET = YES
JAVADOC_AUTOBRIEF = YES
ENABLE_PREPROCESSING = YES
MARKDOWN_SUPPORT = YES
MACRO_EXPANSION = YES
ALIASES = "rst=\verbatim embed:rst:leading-asterisk\n"
ALIASES += "endrst=\n\endverbatim"
ALIASES += "rst{1}=\rst\1\endrst"

View file

@ -1 +0,0 @@
../extra/guile/README.rst

View file

@ -1,6 +0,0 @@
Implementation overview
=======================
.. image:: https://upload.wikimedia.org/wikipedia/commons/e/e6/%22Work_in_progress%22%2C_animated.gif
:alt: Work in Progress
:align: center

View file

@ -1,31 +0,0 @@
.. include:: ../README.rst
:end-before: include:index/end
Contents
--------
.. toctree::
:caption: User Manual
:maxdepth: 3
introduction
design
containers
transients
algorithms
utilities
memory
.. toctree::
:caption: Experimental
:maxdepth: 3
python
guile
----
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View file

@ -1,6 +0,0 @@
Introduction
============
.. include:: ../README.rst
:start-after: include:introduction/start

View file

@ -1,204 +0,0 @@
Memory management
=================
Memory management is specially important for immutable data
structures. This is mainly due to:
#. In order to preserve the old value, new memory has to be allocated
to store the new data whenever a container is manipulated. Thus,
more allocations are performed *when changing* than with traditional
mutable data structures.
#. In order to support *structural sharing* transparently, some kind
of garbage collection mechanism is required. Passing immutable
data structures around is, internally, just passing references,
thus the system needs to figure out somehow when old values are not
referenced anymore and should be deallocated.
Thus, most containers in this library can be customized via policies_
in order to use different *allocation* and *garbage collection*
strategies.
.. doxygentypedef:: immer::default_memory_policy
.. doxygentypedef:: immer::default_heap_policy
.. doxygentypedef:: immer::default_refcount_policy
.. _policies: https://en.wikipedia.org/wiki/Policy-based_design
.. _memory policy:
Memory policy
-------------
.. doxygenstruct:: immer::memory_policy
:members:
:undoc-members:
.. _gc:
Example: tracing garbage collection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is note worthy that all aspects of a
:cpp:class:`immer::memory_policy` are not completely orthogonal.
Let's say you want to use a `tracing garbage collector`_. Actually, we
already provide :cpp:class:`a heap <immer::gc_heap>` that interfaces
with the `Boehm's conservative garbage collector`_. Chunks of memory
allocated with this heap do not need to be deallocated, instead, after
a certain number of allocations, the heap itself will scan the stack
and all allocated memory to find references to other blocks of memory.
The memory that is not referenced anymore is automatically *freed*.
Thus, no reference counting mechanism is needed, and it makes no sense
to use this heap with anything else than the
:cpp:class:`immer::no_refcount_policy`. Also, a big object can be
separated in parts that contain pointers and parts that do not, which
make scanning references faster. So it makes most sense to use
``prefer_fewer_bigger_objects = false``.
.. note:: There are few considerations to note when using
:cpp:class:`gc_heap` with containers. Please make sure to
read :cpp:class:`its documentation section <immer::gc_heap>`
before using it.
.. literalinclude:: ../example/vector/gc.cpp
:language: c++
:start-after: example/start
:end-before: example/end
.. _boehm's conservative garbage collector: https://github.com/ivmai/bdwgc
.. _tracing garbage collector: https://en.wikipedia.org/wiki/Tracing_garbage_collection
Heaps
-----
A **heap policy** is a `metafunction class`_ that given the sizes of
the objects that we want to allocate, it *returns* a heap that can
allocate objects of those sizes.
.. _metafunction class: http://www.boost.org/doc/libs/1_62_0/libs/mpl/doc/refmanual/metafunction-class.html
A **heap** is a type with a methods ``void* allocate(std::size_t)``
and ``void deallocate(void*)`` that return and release raw memory.
For a canonical model of this concept check the
:cpp:class:`immer::cpp_heap`.
.. note:: Currently, *heaps* can only have **global state**. Having
internal state poses conceptual problems for immutable data
structures: should a `const` method of a container modify
its internal allocator state? Should every immutable
container object have its own internal state, or new objects
made from another one just keep a reference to the allocator
of the parent?
On the other hand, having some **scoped state** does make
sense for some use-cases of immutable data structures. For
example, we might want to support variations of `region
based allocation`_. This interface might evolve to evolve
to support some kind of non-global state to accommodate
these use cases.
.. _region based allocation: https://en.wikipedia.org/wiki/Region-based_memory_management
.. admonition:: Why not use the standard allocator interface?
The standard allocator API was not designed to support different
allocation strategies, but to abstract over the underlying memory
model instead. In C++11 the situation improves, but the new API is
*stateful*, posing various challenges as described in the previous
note. So far it was easier to provide our own allocation
interface. In the future, we will provide adaptors so
standard-compatible allocators can also be used with ``immer``.
Heap policies
~~~~~~~~~~~~~
.. doxygenstruct:: immer::heap_policy
:members:
:undoc-members:
.. doxygenstruct:: immer::free_list_heap_policy
Standard heap
~~~~~~~~~~~~~
.. doxygenstruct:: immer::cpp_heap
:members:
Malloc heap
~~~~~~~~~~~
.. doxygenstruct:: immer::malloc_heap
:members:
Garbage collected heap
~~~~~~~~~~~~~~~~~~~~~~
.. doxygenclass:: immer::gc_heap
Heap adaptors
~~~~~~~~~~~~~
Inspired by `Andrei Alexandrescu's talk on allocators <allocation
vexation>`_ and `Emery Berger's heap layers <heap layers>`_ we provide
allocator adaptors that can be combined using C++ mixins. These
enable building more complex allocator out of simpler strategies, or
provide application specific optimizations on top of general
allocators.
.. _allocation vexation: https://www.youtube.com/watch?v=LIb3L4vKZ7U
.. _heap layers: https://github.com/emeryberger/Heap-Layers
.. doxygenstruct:: immer::with_data
.. doxygenstruct:: immer::free_list_heap
.. doxygenstruct:: immer::thread_local_free_list_heap
.. doxygenstruct:: immer::unsafe_free_list_heap
.. doxygenstruct:: immer::identity_heap
.. doxygenstruct:: immer::debug_size_heap
.. doxygenstruct:: immer::split_heap
.. _rc:
Reference counting
------------------
`Reference counting`_ is the most commonly used garbage collection
strategy for C++. It can be implemented non-intrusively, in a way
orthogonal to the allocation strategy. It is deterministic, playing
well with RAII_.
A `memory policy`_ can provide a reference counting strategy that
containers can use to track their contents.
.. _reference counting: https://en.wikipedia.org/wiki/Reference_counting
.. _raii: https://en.wikipedia.org/wiki/Resource_acquisition_is_initialization
.. doxygenstruct:: immer::refcount_policy
.. doxygenstruct:: immer::unsafe_refcount_policy
.. doxygenstruct:: immer::no_refcount_policy
Transience
----------
In order to support `transients`, it is needed to provide a mechanism
to track the ownership of the data allocated inside the container.
This concept is encapsulated in *transience policies*.
Note that when :ref:`reference counting <rc>` is available, no such mechanism is
needed. However, when :ref:`tracing garbage collection<gc>` is used instead,
a special policy has to be provided. Otherwise, the transient API is
still available, but it will perform poorly, since it won't be able to
mutate any data in place.
.. doxygenstruct:: immer::no_transience_policy
.. doxygenstruct:: immer::gc_transience_policy

View file

@ -1 +0,0 @@
../extra/python/README.rst

Some files were not shown because too many files have changed in this diff Show more