Google Online Security Blog: Introducing the Tink cryptographic software library
tink
google
java
c++
boringssl
ssl
jca
crypto
august 2018 by jm
Tink aims to provide cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse. Tink is built on top of existing libraries such as BoringSSL and Java Cryptography Architecture, but includes countermeasures to many weaknesses in these libraries, which were discovered by Project Wycheproof, another project from our team.
With Tink, many common cryptographic operations such as data encryption, digital signatures, etc. can be done with only a few lines of code.
august 2018 by jm
The BARR-C:2018 Embedded C Coding Standard
august 2018 by jm
'Barr Group's Embedded C Coding Standard was developed to minimize bugs in firmware by focusing on practical rules that keep bugs out--while also improving the maintainability and portability of embedded software. The coding standard details a set of guiding principles as well as specific naming conventions and other rules for the use of data types, functions, preprocessor macros, variables and much more. Individual rules that have been demonstrated to reduce or eliminate certain types of bugs are highlighted. In this latest version, BARR-C:2018, the stylistic coding rules have been fully harmonized with MISRA C: 2012, while helping embedded system designers reduce defects in firmware written in C and C++.'
embedded
c
coding
standards
style-guides
misra
c++
august 2018 by jm
rr: lightweight recording & deterministic debugging
(via Kevin Lyda and b0rk)
debug
gdb
mozilla
debugging
coding
cli
c++
c
march 2018 by jm
aspires to be your primary C/C++ debugging tool for Linux, replacing — well, enhancing — gdb. You record a failure once, then debug the recording, deterministically, as many times as you want. The same execution is replayed every time. rr also provides efficient reverse execution under gdb. Set breakpoints and data watchpoints and quickly reverse-execute to where they were hit.
(via Kevin Lyda and b0rk)
march 2018 by jm
Undefined Behavior in 2017
july 2017 by jm
This is an extremely detailed post on the state of dynamic checkers in C/C++ (via the inimitable Marc Brooker):
via:marc-brooker
c
c++
coding
testing
debugging
dynamic-analysis
valgrind
asan
ubsan
tsan
Recently we’ve heard a few people imply that problems stemming from undefined behaviors (UB) in C and C++ are largely solved due to ubiquitous availability of dynamic checking tools such as ASan, UBSan, MSan, and TSan. We are here to state the obvious — that, despite the many excellent advances in tooling over the last few years, UB-related problems are far from solved — and to look at the current situation in detail.
july 2017 by jm
Seastar
september 2015 by jm
C++ high-performance app framework; 'currently focused on high-throughput, low-latency I/O intensive applications.'
Scylla (Cassandra-compatible NoSQL store) is written in this.
c++
opensource
performance
framework
scylla
seastar
latency
linux
shared-nothing
multicore
Scylla (Cassandra-compatible NoSQL store) is written in this.
september 2015 by jm
Explanation of the Jump Consistent Hash algorithm
march 2015 by jm
I blogged about the amazing stateless Jump Consistent Hash algorithm last year, but this is a good walkthrough of how it works.
Apparently one author, Eric Veach, is legendary -- https://news.ycombinator.com/item?id=9209891 : "Eric Veach is huge in the computer graphics world for laying a ton of the foundations of modern physically based rendering in his PhD thesis [1]. He then went on to work for Pixar and did a ton of work on Renderman (for which he recently got an Academy Award), and then in the early 2000ish left Pixar to go work for Google, where he was the lead on developing AdWords [2]. In short, he's had quite a career, and seeing a new paper from him is always interesting."
eric-veach
consistent-hashing
algorithms
google
adwords
renderman
pixar
history
coding
c
c++
Apparently one author, Eric Veach, is legendary -- https://news.ycombinator.com/item?id=9209891 : "Eric Veach is huge in the computer graphics world for laying a ton of the foundations of modern physically based rendering in his PhD thesis [1]. He then went on to work for Pixar and did a ton of work on Renderman (for which he recently got an Academy Award), and then in the early 2000ish left Pixar to go work for Google, where he was the lead on developing AdWords [2]. In short, he's had quite a career, and seeing a new paper from him is always interesting."
march 2015 by jm
8 gdb tricks you should know (Ksplice Blog)
january 2015 by jm
These are very good -- bookmarking for the next time I'm using gdb, probably about 3 years from now
c
debugging
gdb
c++
tips
coding
january 2015 by jm
coz
december 2014 by jm
A causal profiler for C++.
I can see this being a good technique to stochastically discover race conditions and concurrency bugs, too.
optimization
c++
performance
coding
profiling
speed
causal-profilers
Causal profiling is a novel technique to measure optimization potential. This measurement matches developers' assumptions about profilers: that optimizing highly-ranked code will have the greatest impact on performance. Causal profiling measures optimization potential for serial, parallel, and asynchronous programs without instrumentation of special handling for library calls and concurrency primitives. Instead, a causal profiler uses performance experiments to predict the effect of optimizations. This allows the profiler to establish causality: "optimizing function X will have effect Y," exactly the measurement developers had assumed they were getting all along.
I can see this being a good technique to stochastically discover race conditions and concurrency bugs, too.
december 2014 by jm
Introducing Proxygen, Facebook's C++ HTTP framework
november 2014 by jm
Facebook's take on libevent, I guess:
c++
facebook
http
servers
libevent
https
spdy
proxygen
libraries
We are excited to announce the release of Proxygen, a collection of C++ HTTP libraries, including an easy-to-use HTTP server. In addition to HTTP/1.1, Proxygen (rhymes with "oxygen") supports SPDY/3 and SPDY/3.1. We are also iterating and developing support for HTTP/2.
Proxygen is not designed to replace Apache or nginx — those projects focus on building extremely flexible HTTP servers written in C that offer good performance but almost overwhelming amounts of configurability. Instead, we focused on building a high performance C++ HTTP framework with sensible defaults that includes both server and client code and that's easy to integrate into existing applications. We want to help more people build and deploy high performance C++ HTTP services, and we believe that Proxygen is a great framework to do so.
november 2014 by jm
CLion – Brand New IDE for C and C++ Developers
september 2014 by jm
JetBrains (makers of the excellent Intelli/J) have come out with a C/C++ refactoring IDE which looks utterly fantastic. If I wind up hacking on C/C++ again in future, I'll be using this one
c
c++
refactoring
ide
intelli-j
clion
jetbrains
editors
coding
september 2014 by jm
Facebook's drop-in replacement for std::vector
september 2014 by jm
Fixes some low-hanging fruit, performance-wise.
'Simply replacing std::vector with folly::fbvector (after having included the folly/FBVector.h header file) will improve the performance of your C++ code using vectors with common coding patterns. The improvements are always non-negative, almost always measurable, frequently significant, sometimes dramatic, and occasionally spectacular.'
(via Tony Finch)
c++
facebook
performance
algorithms
vectors
via:fanf
optimization
'Simply replacing std::vector with folly::fbvector (after having included the folly/FBVector.h header file) will improve the performance of your C++ code using vectors with common coding patterns. The improvements are always non-negative, almost always measurable, frequently significant, sometimes dramatic, and occasionally spectacular.'
(via Tony Finch)
september 2014 by jm
cloudflare/lua-aho-corasick
august 2014 by jm
A nice Lua/C++ implementation of Aho-Corasick for fast string matching against multiple patterns (via JGC). This uses an interesting technique to get better performance by compacting the data structure into a single buffer, to avoid following pointers all over RAM and busting the cache.
optimization
speed
performance
aho-corasick
tries
string-matching
strings
algorithms
lua
c++
via:jgc
august 2014 by jm
"Pitfalls of Object Oriented Programming", SCEE R&D
july 2014 by jm
Good presentation discussing "data-oriented programming" -- the concept of optimizing memory access speed by laying out large data in a columnar format in RAM, rather than naively in the default layout that OOP design suggests
columnar
ram
memory
optimization
coding
c++
oop
data-oriented-programming
data
cache
performance
july 2014 by jm
FlatBuffers: Main Page
june 2014 by jm
A new serialization format from Google's Android gaming team, supporting C++ and Java, open source under the ASL v2. Reasons to use it:
Looks nice, but it misses the language coverage of protobuf. Definitely more practical than capnproto.
c++
google
java
serialization
json
formats
protobuf
capnproto
storage
flatbuffers
Access to serialized data without parsing/unpacking - What sets FlatBuffers apart is that it represents hierarchical data in a flat binary buffer in such a way that it can still be accessed directly without parsing/unpacking, while also still supporting data structure evolution (forwards/backwards compatibility).
Memory efficiency and speed - The only memory needed to access your data is that of the buffer. It requires 0 additional allocations. FlatBuffers is also very suitable for use with mmap (or streaming), requiring only part of the buffer to be in memory. Access is close to the speed of raw struct access with only one extra indirection (a kind of vtable) to allow for format evolution and optional fields. It is aimed at projects where spending time and space (many memory allocations) to be able to access or construct serialized data is undesirable, such as in games or any other performance sensitive applications. See the benchmarks for details.
Flexible - Optional fields means not only do you get great forwards and backwards compatibility (increasingly important for long-lived games: don't have to update all data with each new version!). It also means you have a lot of choice in what data you write and what data you don't, and how you design data structures.
Tiny code footprint - Small amounts of generated code, and just a single small header as the minimum dependency, which is very easy to integrate. Again, see the benchmark section for details.
Strongly typed - Errors happen at compile time rather than manually having to write repetitive and error prone run-time checks. Useful code can be generated for you.
Convenient to use - Generated C++ code allows for terse access & construction code. Then there's optional functionality for parsing schemas and JSON-like text representations at runtime efficiently if needed (faster and more memory efficient than other JSON parsers).
Looks nice, but it misses the language coverage of protobuf. Definitely more practical than capnproto.
june 2014 by jm
rr
march 2014 by jm
A cool-looking new debugging tool for C/C++ from Mozilla.
Low runtime overhead; easy deployability; targeted at 32-bit (?!) Linux; OSS. (via Bryan O'Sullivan)
via:bos
mozilla
debugging
coding
firefox
rr
record
replay
gdb
c++
linux
Many, many people have noticed that if we had a way to reliably record program execution and replay it later, with the ability to debug the replay, we could largely tame the nondeterminism problem. This would also allow us to deliberately introduce nondeterminism so tests can explore more of the possible execution space, without impacting debuggability. Many record and replay systems have been built in pursuit of this vision. (I built one myself.) For various reasons these systems have not seen wide adoption. So, a few years ago we at Mozilla started a project to create a new record-and-replay tool that would overcome the obstacles blocking adoption. We call this tool rr.
Low runtime overhead; easy deployability; targeted at 32-bit (?!) Linux; OSS. (via Bryan O'Sullivan)
march 2014 by jm
Simple Binary Encoding
december 2013 by jm
'SBE is an OSI layer 6 representation for encoding and decoding application messages in binary format for low-latency applications.'
Licensed under ASL2, C++ and Java supported.
sbe
encoding
codecs
persistence
binary
low-latency
open-source
java
c++
serialization
Licensed under ASL2, C++ and Java supported.
december 2013 by jm
Cap'n Proto
Basically, marshalling like writing an aligned C struct to the wire, QNX messaging protocol-style. Wasteful on space, but responds to this by suggesting compression (which is a fair point tbh). C++-only for now. I'm not seeing the same kind of support for optional data that protobufs has though. Overall I'm worried there's some useful features being omitted here...
serialization
formats
protobufs
capn-proto
protocols
coding
c++
rpc
qnx
messaging
compression
compatibility
interoperability
i14y
april 2013 by jm
Cap’n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster. In fact, in benchmarks, Cap’n Proto is INFINITY TIMES faster than Protocol Buffers.
Basically, marshalling like writing an aligned C struct to the wire, QNX messaging protocol-style. Wasteful on space, but responds to this by suggesting compression (which is a fair point tbh). C++-only for now. I'm not seeing the same kind of support for optional data that protobufs has though. Overall I'm worried there's some useful features being omitted here...
april 2013 by jm
C++ B-Tree
february 2013 by jm
a new C++ template library from Google which implements an in-memory B-Tree container type, suitable for use as a drop-in replacement for std::map, set, multimap and multiset. Lower memory use, and reportedly faster due to better cache-friendliness
c++
google
data-structures
containers
b-trees
stl
map
set
open-source
february 2013 by jm
#AltDevBlogADay » Functional Programming in C++
october 2012 by jm
John Carmack makes a case for writing C++ in an FP style, with wide use of const and pure functions. something similar can be achieved in pure Java using Guava's Immutable types, to a certain extent. I love his other posts on this site -- he argues persuasively for static code analysis and keeping multiple alternative subsystem implementations, too
c++
programming
functional-programming
fp
coding
john-carmack
const
immutability
october 2012 by jm
experimental CPU-cache-aware hash table implementations in Cloudera's Impala
october 2012 by jm
via Todd Lipcon -- https://twitter.com/tlipcon/status/261113382642532352
'another cool piece of cloudera impala source: cpu-cache-aware hash table implementations by @jackowayed'. 'L1-sized hash table that hopes to use cache well. Each bucket is a chunk list of tuples. Each chunk is a cache line.'
hashing
hash-tables
data-structures
performance
c++
l1
cache
cpu
'another cool piece of cloudera impala source: cpu-cache-aware hash table implementations by @jackowayed'. 'L1-sized hash table that hopes to use cache well. Each bucket is a chunk list of tuples. Each chunk is a cache line.'
october 2012 by jm
1024cores
august 2012 by jm
Some good algorithms and notes by Dmitry Vyukov on 'lockfree, waitfree, obstruction-free synchronization algorithms and data structures, scalability-oriented architecture, multicore/multiprocessor design patterns, high-performance computing, threading technologies and libraries (OpenMP, TBB, PPL), message-passing systems and related topics.' The catalog of lock-free queue implementations is particularly extensive (via Sergio Bossa)
algorithms
concurrency
articles
dmitry-vyukov
go
c++
coding
via:sergio-bossa
august 2012 by jm
"Source Code Optimisation", Felix von Leitner, Linux Kongress 2009 [PDF]
november 2009 by jm
Good presentation on C compiler optimization, via Cal Henderson. 'People often write less readable code because they think it will produce faster code. Unfortunately, in most cases, the code will not be faster.' I particularly like 'Fancy-Schmancy Algorithms': 'If you have 10-100 elements, use a list, not a red-black tree; Fancy data structures help on paper, but rarely in reality. (More space overhead in the data structure, less L2 cache left for actual data.)'
via:iamcal
compilers
c
c++
optimization
coding
assembly
speed
from delicious
november 2009 by jm
related tags
abseil ⊕ adwords ⊕ aho-corasick ⊕ algorithms ⊕ articles ⊕ asan ⊕ asl2 ⊕ assembly ⊕ async ⊕ b-trees ⊕ binary ⊕ boringssl ⊕ c ⊕ c++ ⊖ c++11 ⊕ c++17 ⊕ cache ⊕ callbacks ⊕ capn-proto ⊕ capnproto ⊕ causal-profilers ⊕ cli ⊕ clion ⊕ codecs ⊕ coding ⊕ columnar ⊕ commons ⊕ compatibility ⊕ compilers ⊕ compression ⊕ concurrency ⊕ consistent-hashing ⊕ const ⊕ containers ⊕ cpu ⊕ crypto ⊕ data ⊕ data-oriented-programming ⊕ data-structures ⊕ debug ⊕ debugging ⊕ dmitry-vyukov ⊕ dynamic-analysis ⊕ editors ⊕ embedded ⊕ encoding ⊕ eric-veach ⊕ facebook ⊕ firefox ⊕ flatbuffers ⊕ formats ⊕ fp ⊕ framework ⊕ functional-programming ⊕ futures ⊕ gdb ⊕ go ⊕ google ⊕ guava ⊕ hash-tables ⊕ hashing ⊕ history ⊕ http ⊕ https ⊕ i14y ⊕ ide ⊕ immutability ⊕ intelli-j ⊕ interoperability ⊕ java ⊕ jca ⊕ jetbrains ⊕ john-carmack ⊕ json ⊕ l1 ⊕ latency ⊕ libevent ⊕ libraries ⊕ library ⊕ linux ⊕ low-latency ⊕ lua ⊕ map ⊕ memory ⊕ messaging ⊕ misra ⊕ mozilla ⊕ multicore ⊕ oop ⊕ open-source ⊕ opensource ⊕ optimization ⊕ option ⊕ performance ⊕ persistence ⊕ pixar ⊕ profiling ⊕ programming ⊕ protobuf ⊕ protobufs ⊕ protocols ⊕ proxygen ⊕ qnx ⊕ ram ⊕ record ⊕ refactoring ⊕ renderman ⊕ replay ⊕ rpc ⊕ rr ⊕ sbe ⊕ scylla ⊕ seastar ⊕ serialization ⊕ servers ⊕ set ⊕ shared-nothing ⊕ spdy ⊕ speed ⊕ ssl ⊕ standards ⊕ stl ⊕ storage ⊕ stout ⊕ string-matching ⊕ strings ⊕ style-guides ⊕ testing ⊕ threading ⊕ tink ⊕ tips ⊕ tries ⊕ try ⊕ tsan ⊕ ubsan ⊕ valgrind ⊕ vectors ⊕ via:bos ⊕ via:fanf ⊕ via:iamcal ⊕ via:jgc ⊕ via:marc-brooker ⊕ via:sergio-bossa ⊕Copy this bookmark: