- 05 Aug, 2018 5 commits
-
-
Kenton Varda authored
-
Kenton Varda authored
-
Kenton Varda authored
This is true even if the pointer-to-member is never actually used, but only has its type matched, which was what kj::size() was trying to do. Oh well, define some damned constants instead.
-
Kenton Varda authored
Hash-based (unordered) and tree-based (ordered) indexing are provided. kj::Table offers advantages over STL: - A Table can have multiple indexes (allowing lookup by multiple keys). Different indexes can use different algorithms (e.g. hash vs. tree) and have different uniqueness constraints. - The properties on which a Table is indexed need not be explicit fields -- they can be computed from the table's row type. - Tables use less memory and make fewer allocations than STL, because rows are stored in a contiguous array. - The hash indexing implementation uses linear probing rather than chaining, which again means far fewer allocations and more cache-friendliness. - The tree indexing implementation uses B-trees optimized for cache line size, whereas STL uses cache-unfriendly and allocation-heavy red-black binary trees. (However, STL trees are overall more cache-friendly; see below.) - Most of the b-tree implementation is not templated. This reduces code bloat, at the cost of some performance due to virtual calls. On an ad hoc benchmark on large tables, the hash index implementation appears to outperform libc++'s `std::unordered_set` by ~60%. However, libc++'s `std::set` still outperforms the B-tree index by ~70%. It looks like the B-tree implementation suffers in part from the fact that keys are not stored inline in the tree nodes, forcing extra memory indirections. This is a price we pay for lower memory usage overall, and the ability to have multiple indexes on one table. The b-tree implementation also suffers somewhat from not being 100% templates, compared to STL, but I think this is a reasonable trade-off. The most performance-critical use cases will use hash indexes anyway.
-
Kenton Varda authored
I'm tired of working around missing features that were added in C++14. It's four years old now, compilers should support it.
-
- 15 Jul, 2018 1 commit
-
-
Kenton Varda authored
VS 2015 is just too buggy. Working around the bugs is wasting developer time. This change does not actually remove any of the hacks yet, so that we can undo this decision if there are significant complaints after the next release.
-
- 31 Jan, 2018 1 commit
-
-
Kenton Varda authored
Array::attach() is like Own::attach(). ArrayPtr::attach() promotes an ArrayPtr to an Array by attaching other objects to it. (Hopefully one of those objects actually owns the underlying array data.)
-
- 11 Jan, 2018 1 commit
-
-
Kenton Varda authored
@kloepper pointed out a while back that every compiler you've ever heard of supports this. Plus, it's more concise, it's not prone to copy-paste errors, and it looks nicer. At the time I wanted to remain consistent and I didn't feel like spending the time to update all my existing code. But, every time I've added a new header since I've cursed the include guard, so I finally broke down and changed it.
-
- 10 Nov, 2017 1 commit
-
-
Kenton Varda authored
-
- 12 Oct, 2017 1 commit
-
-
Edward Catmur authored
Detected by -fsanitize=vla-bound
-
- 21 Sep, 2017 1 commit
-
-
Erik Murphy-Chutorian authored
-
- 19 Sep, 2017 1 commit
-
-
Kenton Varda authored
-
- 12 Sep, 2017 1 commit
-
-
Kenton Varda authored
E.g.: "foo"_kj This literal will have type StringPtr. Although any string literal can implicitly cast to StringPtr, using the _kj suffix has the advantage that it can be constexpr.
-
- 27 Jun, 2017 1 commit
-
-
Kenton Varda authored
-
- 01 Jun, 2017 1 commit
-
-
Kenton Varda authored
-
- 23 May, 2017 1 commit
-
-
Kenton Varda authored
- Rename UtfResult -> EncodingResult - Make it usable like a Maybe, so that we don't need separate "try" functions. - Check errors in hex decoding and URI decoding.
-
- 22 May, 2017 1 commit
-
-
Kenton Varda authored
This conversion would end up including the NUL terminator in the array, which is almost never what you want. We can perhaps re-enable this in the future and have it automatically remove the NUL terminator, but we should do at least one release with it disabled to catch anyone who might be affected by the change in behavior.
-
- 05 May, 2017 1 commit
-
-
Kenton Varda authored
-
- 29 Apr, 2017 2 commits
-
-
Harris Hancock authored
VS2015 only barely compiled ~NullableValue's noexcept specifier expression. VS2017 can't at all, so we're going with noexcept(false) for MSVC for now.
-
Kenton Varda authored
-
- 25 Apr, 2017 1 commit
-
-
Kenton Varda authored
Fixes #212
-
- 11 Apr, 2017 1 commit
-
-
Kenton Varda authored
-
- 10 Apr, 2017 1 commit
-
-
Kenton Varda authored
-
- 07 Apr, 2017 3 commits
-
-
Kenton Varda authored
I'm not really sure how Cap'n Proto has worked at all on GCC 5. For some reason this only ended up being tickled after e6e29122. Fixes #442.
-
Kenton Varda authored
-
Kenton Varda authored
-
- 30 Mar, 2017 2 commits
-
-
Kenton Varda authored
Since this header is included by everyone, and units.h has lots of templates, this seems like it could significantly improve build times.
-
Kenton Varda authored
-
- 29 Mar, 2017 1 commit
-
-
Kenton Varda authored
-
- 24 Mar, 2017 2 commits
-
-
Kenton Varda authored
The problem with kj::range() is that if the inputs are not recognized as the same type, the typechecker can get annoyed.
-
Kenton Varda authored
-
- 24 Jan, 2017 3 commits
-
-
Harris Hancock authored
MSVC refuses the following code: struct Foo { Foo(Foo&) {} }; Foo foo; [foo] {}(); because it only seems to want to consider const copy constructors when capturing objects by value in lambda capture lists.
-
Harris Hancock authored
-
Kenton Varda authored
-
- 15 Nov, 2016 1 commit
-
-
Harris Hancock authored
-
- 13 Jun, 2016 1 commit
-
-
Branislav Katreniak authored
-
- 20 May, 2016 2 commits
-
-
Harris Hancock authored
-
Harris Hancock authored
MSVC cannot compile the overloaded member function SFINAE technique used in Kind_ and FromAny_. It has an easier time with std::void_t-style SFINAE.
-
- 02 May, 2016 1 commit
-
-
Kenton Varda authored
Fix JSON handler for DynamicStruct. The handler needs to be told the struct's schema to construct an orphan. Also improve error message when addTypeHandler() is given a handler for a dynamic type but no specific schema is specified. We could support this eventually but we don't presently.
-
- 06 Apr, 2016 1 commit
-
-
Harris Hancock authored
-