-
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into box-recursive-type
- Loading branch information
Showing
140 changed files
with
5,893 additions
and
24,832 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:ubuntu | ||
|
||
# cache /nix | ||
VOLUME /nix | ||
|
||
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux \ | ||
--extra-conf "sandbox = false" \ | ||
--init none \ | ||
--no-confirm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu | ||
{ | ||
"name": "Ubuntu", | ||
"dockerFile": "Dockerfile", | ||
"context": "${localWorkspaceFolder}", | ||
"runArgs": [ | ||
"--security-opt", | ||
"label=disable" | ||
], | ||
"mounts": [ | ||
"source=nix-ubuntu-container,target=/nix,type=volume" | ||
], | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
// "image": "mcr.microsoft.com/devcontainers/base:${templateOption:imageVariant}" | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "uname -a", | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"xaver.clang-format", | ||
"arrterian.nix-env-selector", | ||
"ms-vscode.cpptools", | ||
"kamadorueda.alejandra" | ||
] | ||
} | ||
}, | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// We need root because nix without systemd works only as root. | ||
"remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Load pretty printers | ||
source tools/gdb_pretty_printers/autoload.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: CIFuzz | ||
on: [pull_request] | ||
jobs: | ||
Fuzzing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build Fuzzers | ||
id: build | ||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master | ||
with: | ||
oss-fuzz-project-name: 'immer' | ||
dry-run: false | ||
language: c++ | ||
- name: Run Fuzzers | ||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master | ||
with: | ||
oss-fuzz-project-name: 'immer' | ||
fuzz-seconds: 300 | ||
dry-run: false | ||
language: c++ | ||
- name: Upload Crash | ||
uses: actions/upload-artifact@v3 | ||
if: failure() && steps.build.outcome == 'success' | ||
with: | ||
name: artifacts | ||
path: ./out/artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,38 +4,33 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # needed for fetchGit in default.nix | ||
- uses: cachix/[email protected] | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install" | ||
- uses: cachix/cachix-action@v10 | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v25 | ||
- uses: cachix/cachix-action@v14 | ||
with: | ||
name: arximboldi | ||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | ||
- run: nix-build | ||
- run: nix build | ||
- run: nix flake check -L | ||
|
||
build-spm: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- run: swift build | ||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: cachix/install-nix-action@v14.1 | ||
- uses: cachix/install-nix-action@v25 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install" | ||
- uses: cachix/cachix-action@v10 | ||
- uses: cachix/cachix-action@v14 | ||
with: | ||
name: arximboldi | ||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | ||
|
@@ -94,12 +89,11 @@ jobs: | |
opts: ['benchmark'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: cachix/install-nix-action@v14.1 | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v25 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install" | ||
- uses: cachix/cachix-action@v10 | ||
- uses: cachix/cachix-action@v14 | ||
with: | ||
name: arximboldi | ||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,5 @@ tools/clojure/.lein* | |
|
||
.build | ||
.swiftpm | ||
.vscode | ||
.pre-commit-config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,15 +111,10 @@ foreach(_file IN LISTS immer_benchmarks) | |
endif() | ||
endforeach() | ||
|
||
set(immer_ssh_method | ||
ssh -p 5488 | ||
-o StrictHostKeyChecking=no) | ||
|
||
add_custom_target(upload-benchmark-reports | ||
COMMAND | ||
rsync -av -e \"${immer_ssh_method}\" | ||
${immer_benchmark_report_base_dir} | ||
[email protected]:public/misc/immer/) | ||
rsync -av ${immer_benchmark_report_base_dir} | ||
[email protected]:/var/lib/syncthing/public/misc/immer/) | ||
|
||
add_custom_target(copy-benchmark-reports | ||
COMMAND | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// | ||
// 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 <boost/container/flat_set.hpp> | ||
#include <hash_trie.hpp> // Phil Nash | ||
#include <immer/set.hpp> | ||
#include <immer/set_transient.hpp> | ||
#include <set> | ||
#include <unordered_set> | ||
|
||
namespace { | ||
|
||
template <typename Generator, typename Set> | ||
auto benchmark_erase_mut_std() | ||
{ | ||
return [](nonius::chronometer meter) { | ||
auto n = meter.param<N>(); | ||
auto g = Generator{}(n); | ||
auto v_ = [&] { | ||
auto v = Set{}; | ||
for (auto i = 0u; i < n; ++i) | ||
v.insert(g[i]); | ||
return v; | ||
}(); | ||
measure(meter, [&] { | ||
auto v = v_; | ||
for (auto i = 0u; i < n; ++i) | ||
v.erase(g[i]); | ||
return v; | ||
}); | ||
}; | ||
} | ||
|
||
template <typename Generator, typename Set> | ||
auto benchmark_erase() | ||
{ | ||
return [](nonius::chronometer meter) { | ||
auto n = meter.param<N>(); | ||
auto g = Generator{}(n); | ||
auto v_ = [&] { | ||
auto v = Set{}.transient(); | ||
for (auto i = 0u; i < n; ++i) | ||
v.insert(g[i]); | ||
return v.persistent(); | ||
}(); | ||
measure(meter, [&] { | ||
auto v = v_; | ||
for (auto i = 0u; i < n; ++i) | ||
v = v.erase(g[i]); | ||
return v; | ||
}); | ||
}; | ||
} | ||
|
||
template <typename Generator, typename Set> | ||
auto benchmark_erase_move() | ||
{ | ||
return [](nonius::chronometer meter) { | ||
auto n = meter.param<N>(); | ||
auto g = Generator{}(n); | ||
auto v_ = [&] { | ||
auto v = Set{}.transient(); | ||
for (auto i = 0u; i < n; ++i) | ||
v.insert(g[i]); | ||
return v.persistent(); | ||
}(); | ||
measure(meter, [&] { | ||
auto v = v_; | ||
for (auto i = 0u; i < n; ++i) | ||
v = std::move(v).erase(g[i]); | ||
return v; | ||
}); | ||
}; | ||
} | ||
|
||
} // namespace |
Oops, something went wrong.