Skip to content

Instantly share code, notes, and snippets.

View gnzlbg's full-sized avatar

gnzlbg gnzlbg

View GitHub Profile
@gnzlbg
gnzlbg / folder.rs
Created January 24, 2017 18:35
syn::Folder v0
use syn::*;
trait Folder: Sized {
// Any additions to this trait should happen in form
// of a call to a public `noop_*` function that only calls
// out to the folder again, not other `noop_*` functions.
//
// This is a necessary API workaround to the problem of not
// being able to call out to the super default method
// in an overridden default method.
@gnzlbg
gnzlbg / fold.rs
Created January 26, 2017 18:34
syn::fold
use std;
use syn;
use syn::*;
pub trait Folder: Sized {
// Any additions to this trait should happen in form
// of a call to a public `noop_*` function that only calls
// out to the folder again, not other `noop_*` functions.
//
// This is a necessary API workaround to the problem of not
@gnzlbg
gnzlbg / flat_set.hpp
Created March 11, 2017 16:05
A flat set container adaptor.
#pragma once
/// \file
///
/// A flat set implemented as a vector-like container adaptor.
#include <hm3/utility/range.hpp>
#include <hm3/utility/small_vector.hpp>
#include <hm3/utility/vector.hpp>
namespace hm3 {
@gnzlbg
gnzlbg / flat_set.hpp
Created March 16, 2017 20:46
flat_set with support for const keys
#pragma once
/// \file
///
/// A flat set implemented as a vector-like container adaptor.
#include <hm3/utility/range.hpp>
#include <hm3/utility/small_vector.hpp>
#include <hm3/utility/vector.hpp>
namespace hm3 {
~/range-v3/range-v3/debug_build_msan> make alg.find VERBOSE=1
/home/gonzalo/pool/bin/cmake -H/home/gonzalo/range-v3/range-v3 -B/home/gonzalo/range-v3/range-v3/debug_build_msan --check-build-system CMakeFiles/Makefile.cmake 0
make -f CMakeFiles/Makefile2 alg.find
make[1]: Entering directory '/aia/r015/home/gonzalo/range-v3/range-v3/debug_build_msan'
/home/gonzalo/pool/bin/cmake -H/home/gonzalo/range-v3/range-v3 -B/home/gonzalo/range-v3/range-v3/debug_build_msan --check-build-system CMakeFiles/Makefile.cmake 0
/home/gonzalo/pool/bin/cmake -E cmake_progress_start /home/gonzalo/range-v3/range-v3/debug_build_msan/CMakeFiles 0
make -f CMakeFiles/Makefile2 test/algorithm/CMakeFiles/alg.find.dir/all
make[2]: Entering directory '/aia/r015/home/gonzalo/range-v3/range-v3/debug_build_msan'
make -f test/algorithm/CMakeFiles/alg.find.dir/build.make test/algorithm/CMakeFiles/alg.find.dir/depend
make[3]: Entering directory '/aia/r015/home/gonzalo/range-v3/range-v3/debug_build_msan'
@gnzlbg
gnzlbg / a.cpp
Last active April 3, 2017 15:29
char ranges:
/// Is \p c an end-of-line character?
///
/// On Linux `\n` and on Windows `\r\n`.
template <typename Char>
constexpr bool is_eol(Char c, Char n = Char{}) noexcept {
return c == '\n' || (c == '\r' && n == '\n');
}
/// Remove EOL characters from the \p line.
template <typename CharStr,
@gnzlbg
gnzlbg / # gcc - 2017-08-30_17-16-30.txt
Created August 30, 2017 15:24
gcc on macOS 10.12.6 - Homebrew build logs
Homebrew build logs for gcc on macOS 10.12.6
Build date: 2017-08-30 17:16:30
Fresh lazy_static v0.2.9
Fresh cfg-if v0.1.2
Fresh unicode-xid v0.1.0
Fresh gcc v0.3.54
Fresh rustc-demangle v0.1.5
Fresh cc v1.0.3
Fresh libc v0.2.33
Fresh proc-macro2 v0.1.3
Fresh quote v0.3.15 (https://github.com/dtolnay/quote#67a9d9ff)
Fresh simd-test-macro v0.1.0 (file:///aia/r018/scratch/gonzalo/stdsimd/stdsimd-test/simd-test-macro)
@gnzlbg
gnzlbg / dump
Created November 15, 2017 09:38
nallocx bench results
Running target/release/deps/nallocx-279f097801d1ca09
running 62 tests
test roundtrip_even_1000000bytes ... bench: 168 ns/iter (+/- 61)
test roundtrip_even_100000bytes ... bench: 231 ns/iter (+/- 105)
test roundtrip_even_10000bytes ... bench: 29 ns/iter (+/- 1)
test roundtrip_even_1000bytes ... bench: 25 ns/iter (+/- 2)
test roundtrip_even_100bytes ... bench: 25 ns/iter (+/- 8)
test roundtrip_even_24bytes ... bench: 26 ns/iter (+/- 10)
@gnzlbg
gnzlbg / gist:c96ddf4b89e4cebc7f7f49b87ac80f21
Created November 16, 2017 19:21
benchmark mallocx, smallocx, nallocx, flags = 0
test rt_even_1000000bytes_mallocx ... bench: 211 ns/iter (+/- 169)
test rt_even_1000000bytes_nallocx ... bench: 219 ns/iter (+/- 109)
test rt_even_1000000bytes_smallocx ... bench: 212 ns/iter (+/- 54)
test rt_even_100000bytes_mallocx ... bench: 235 ns/iter (+/- 47)
test rt_even_100000bytes_nallocx ... bench: 224 ns/iter (+/- 155)
test rt_even_100000bytes_smallocx ... bench: 233 ns/iter (+/- 170)
test rt_even_10000bytes_mallocx ... bench: 28 ns/iter (+/- 4)
test rt_even_10000bytes_nallocx ... bench: 35 ns/iter (+/- 26)
test rt_even_10000bytes_smallocx ... bench: 29 ns/iter (+/- 19)
test rt_even_1000bytes_mallocx ... bench: 23 ns/iter (+/- 14)