Baptiste Wicht
baptiste-wicht.com · Personal blog · on HN since 2010
Baptiste Wicht, a software developer, writes about C++ and Java, with benchmarks, compiler speed tests and tooling tips.
What HN saysCommenters link his C++ benchmark of vector against list, his Java 7 interface posts and his guide to Mutt with notmuch.
26HN people shared it
11linked it in comments
38stories submitted
456story points
4 years agolast shared
2010people per year2026
Most-shared posts
- 1Cpp benchmark vector list deque5 people · first shared 2014
- 2Zapcc C++ compilation speed against gcc 5.4 and clang 3.93 people · 7 points · first shared 2016 · 1 comments on HN
- 3Use templight and Templar to debug C++ templates2 people · 2 points · first shared 2016 · discussion on HN
- 4Java 7 : Add “public defender methods” to Java interfaces2 people · 1 points · first shared 2010 · discussion on HN
- 5Zapcc – A faster C++ compiler1 people · 88 points · first shared 2016 · 88 comments on HN
- 6Java 7: Oracle pushes a first version of closures1 people · 85 points · first shared 2010 · 57 comments on HN
- 7Java 7 is adding dynamics1 people · 51 points · first shared 2010 · 14 comments on HN
- 8Java 7 : More concurrency1 people · 47 points · first shared 2010 · 16 comments on HN
- 9Java 7 : The new java.util.Objects class1 people · 38 points · first shared 2010 · 33 comments on HN
- 10Java 7 I/O: Asynch operations, multicasting, random access with JSR 203 (NIO.2)1 people · 29 points · first shared 2010 · discussion on HN
- 11Deep Learning Library 1.0 – Fast Neural Network Library1 people · 17 points · first shared 2017 · discussion on HN
- 12Java 7 : The new try-with-resources statement1 people · 17 points · first shared 2010 · 19 comments on HN
- 13Java Concurrency : Part 2 – Manipulate Threads1 people · 13 points · first shared 2010 · discussion on HN
- 14The new Path API in Java 71 people · 11 points · first shared 2010 · discussion on HN
- 15Java Concurrency – Part 4 : Semaphores1 people · 10 points · first shared 2010 · discussion on HN
What HN people wrote when they linked it
dredmorbius · 2022-04-09
Mutt + notmuch (search) gives you all that archival, excellent filtering, keyboard-driven navigation, and the advantage of cutting Google off your own personal journal datastream.
https://baptiste-wicht.com/posts/2014/08/a-mutt-journey-search-mails-w…
Biqh1 · 2018-09-02
When I set up my personal gmail with Mutt, I used the following guides, if you're interested. None of them are perfect, so I did what most people do and took bits and bobs from all of them:
1. [https://smalldata.tech/blog/2016/09/10/gmail-with-mutt]
2. [http://stevelosh.com/blog/2012/10/the-homely-mutt/]
3. [https://baptiste-wicht.com/posts/2014/07/a-mutt-journey-my-mutt-config…
albinofrenchy · 2015-06-25
The point I was trying to make though is that even with 100mil datapoints you are looking at probably less than 50 reallocs. In userland, the story is even nicer because that actual reserve space in the vector is mostly going to be deferred until you actually write to it.
I don't get the point about additional independent properties. Size of the struct changes the memory you need to grab, but not the number of reallocs you have to do.
See: http://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector-list-dequ… for actual benchmarks on this. If you disagree with these benchmarks, and find your own results to be different, I'd love to see the write up on that, and I'm sure I'm not the only one.
rkalla · 2011-07-28
I wasn't even aware of that proposal, just found these examples[1] and love the idea.
Sort of in the same vein as static imports (as far as usability) but has a really nice added side effect of exporting a default impl from an interface that can be overridden.
Thanks!
[1] http://www.baptiste-wicht.com/2010/05/java-7-add-public-defender-metho…
linkdd · 2022-03-30
> using std::list ever is laughable
https://baptiste-wicht.com/posts/2012/11/cpp-benchmark-vector-vs-list.…
> some of us have been around the block a few times though, and now need to make sure those spaces are delineated for others in a way that won't force them into a performance corner.
This, just like the rest of your comment, is just patronizing and condescendant.
> I don't mean to brag, but I guess I'm a lot better at planning ahead than you
See previous point...
> I also can't remember any time I had to reach for a hammer as big as reflect and didn't expect to very early on
This is not what I said at all. Let's say you know early on, before any code is written, you will need reflection. Can you tell me how many calls to the reflection API will happen before-hand? Is it `n`? `nlog(n)`? `n²`? Will you use reflection at every corner, or just on the boundaries of your task? Once implemented, could it be refactored in a simpler way? You don't know until you wrote the code.
> most of the time I know what I intend to do to my data
"what" is the spec, "how" is the code, and there is multiple answers to the "how", until you write them and benchmark them, you can't know for sure which one is the best, you can only have assumptions/hypothesis. Unless you're doing constantly exactly the same thing.
> but also maybe think about how many pointers you're going to have to chase and methods your users will need to implement in the first place because you probably don't…
stonemetal12 · 2022-11-01
Probably isn't too bad. chunks probably fill a cache line. Then it is just a question of whether or not beam inserts prefetches for the next chunk, and or the CPU prefetch realizes we are chasing this set of pointers.
Note: I am more familiar with C++, so C++ digression here.
C++ has std::deque that is a similar non-contiguous chunked container, comparing it to std::vector(the contiguous container) it is really close for things vector is good at, and better than it at things vector is bad at like random insert and removal.
https://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector-list-deq…
urthor · 2022-06-06
https://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector-list-deq…
From 2012. std::deque does very well.
Suspect the difference is fairly anaemic.
Usually if you're choosing data structures, you pick a "good enough choice," (any of the three).
Or, if it matters, you pull out your profiler and pick the "exact" right one.
dymk · 2019-08-18
Yes, Templite and Templar: https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-…
jcelerier · 2018-09-11
> linked-lists are unnecessary, performance killers, and generally evil.
that's true on any CPU with more than 16kb of cache. linked lists were a good idea at the time of 486, not so much at the time of modern CPUs with 8+ megabytes of L3.
See https://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector-list-deq…
osense · 2016-07-18
Another fun way to solve this is using Logic programming, e.g. http://baptiste-wicht.com/posts/2010/09/solve-einsteins-riddle-using-p…
cheepin · 2014-04-02
Interestingly, a red-black tree can be viewed as a BTree [0].
Another case where caching plays a huge role in determining the most efficient data structure (See vector vs list [1]).
[0]: http://en.wikipedia.org/wiki/Red%E2%80%93black_tree#Analogy_to_B-trees…
[1]: http://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector-list-dequ…