Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
charleslmunger
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
91.
▲
by
charleslmunger
2y ago
>Then you have to malloc the struct to be the sizeof the struct + whatever size you want the array to be. Ultra pedantic, but you actually do not need to alloc struct+size; you want something like: // A flexible array mem
92.
▲
by
charleslmunger
2y ago
All the questions I come up with that are both narrow enough in scope to reasonably do in an interview and get unhelpful answers from an LLM end up being trick questions for humans too, which is not really fair or productive. What's pa
93.
▲
by
charleslmunger
2y ago
>Beyond that, Intel recently updated their manual to retroactively define the behavior of BSR/BSF on zero inputs: it leaves the destination register unmodified. This is very nice of them to do, but I found while optimizing a routine
94.
▲
by
charleslmunger
2y ago
If your warm and cold starts are that close I'take a closer look at your measurement methodology. Could be your cold starts are actually warm, or your timing is starting late.
95.
▲
by
charleslmunger
2y ago
>RAM access on modern hardware has a latency of something like 10 nanoseconds What modern hardware are you using that this is true? That's faster than L3 cache on many processors.
96.
▲
by
charleslmunger
2y ago
Sieve of Erastothenes is often introduced alongside prime numbers in elementary school math class and it has a funny/memorable name - it's not that weird for someone to know it. It is weird to lie about having a practical use case
97.
▲
by
charleslmunger
2y ago
https://www.washingtonpost.com/wp-dyn/content/article/2008/0...
98.
▲
by
charleslmunger
2y ago
> 1) tests take too long to run 2) difficult to root cause breakages. I have gotten a ton of value out of targetting these problems specifically. Some low-cost-high-value test infra changes: 1. Passing tests are not allowed to emit error
99.
▲
by
charleslmunger
2y ago
You'll be thrilled to hear about upb then, which was designed to be embeddable to power other languages without a from-scratch implementation - and now powers python protos. https://github.com/protocolbuffers/proto
100.
▲
by
charleslmunger
2y ago
Home Assistant's Android app does work with client certificates. https://companion.home-assistant.io/docs/getting_started/#tl...
101.
▲
by
charleslmunger
2y ago
If you're interested in DIY: LED lights as a string or strip - sk8612 are RGBW, which you need if you want a nice looking white. Lots of strips of varying density and waterproofing are available everywhere; strings ("pixels")
102.
▲
by
charleslmunger
2y ago
>As an old-timer, I think you have some serious misconception about how RAII works, and what it does for you. I appreciate the education :-) >There's nothing that stops you from using arena allocators in C++. This is true, but ar
103.
▲
by
charleslmunger
2y ago
As a relative newcomer to C++, I have found RAII to be fine for writing in object-oriented style. But I would only subject myself to the suffering and complexity of C++ if I really wanted excellent performance, and while RAII does not gener
104.
▲
by
charleslmunger
2y ago
You can run grpc over binder: https://github.com/grpc/grpc-java/blob/master/binder/src/mai... The overhead is low, and you get best practices like oneway calls and avoiding the transaction limi
105.
▲
by
charleslmunger
2y ago
Clang emits a warning if you ask it to vectorize a loop and it can't; you can then promote that to an error. But even if the loop vectorizes, that doesn't mean that it vectorizes in the optimal way - my understanding is that pros
106.
▲
by
charleslmunger
2y ago
From the article: >A recent analysis by the Economist found that among the heaviest one percent of American cars, 12 people die inside smaller models for each person saved by the enormity of their vehicle. What benefit exactly are hundre
107.
▲
by
charleslmunger
2y ago
>Yet people still start businesses, make money, grumble endlessly about those regulations, and society marches on. One such regulation is "certificate of need" laws, where you effectively need to ask the incumbent for permissio
108.
▲
by
charleslmunger
2y ago
Well, if you aren't constrained in the format, write it out as fixed width integers as small as you can, mmap the file, madvise as MADV_SEQUENTIAL, and scan with a branch free loop the compiler will vectorize. You'll saturate your
109.
▲
by
charleslmunger
2y ago
I noticed: 1. Small read buffers. No reason to sequentially read and parse gigabytes only 4kb at a time. 2. parseDelimitedFrom created a new CodedInputStream on every message, which has its own internal buffer; that's why you don'
110.
▲
by
charleslmunger
2y ago
Linux perf would do this if you profile for "backend stalls".
111.
▲
by
charleslmunger
2y ago
The real argument from that piece is that heap allocation is something to be avoided, and there are alternatives to malloc/free pairs. There are other benefits, but specifically having the compiler insert lots of frees is not one of th
112.
▲
by
charleslmunger
2y ago
You don't need to turn off synchronous mode, but you can set it to NORMAL, which will only fsync when compacting the WAL file. Another great pattern for batch writes is to use a system like Nagle's algorithm - push stuff into a qu
113.
▲
by
charleslmunger
2y ago
>What C programmer hears, “you can heap allocate without a GC and the compiler will place frees for you” and thinks, gosh… this sounds irritating? People who still use C rather than C++, which has this exact feature? https://o
114.
▲
by
charleslmunger
2y ago
The statement about "4,500 developer-years of work" is insane to me. Java is one of the most backward compatible languages period - other than hashmap iteration order a while back, it's hard to think of what could require tha
115.
▲
by
charleslmunger
2y ago
https://github.com/markqvist/Reticulum/tree/6ded42edd7ae203e... I am struggling to understand who the overlap between people who can accurately assess the risk of each of these implementations and correctly f
116.
▲
by
charleslmunger
2y ago
If you have analytics, a PM being able to answer their own behavior/business questions by querying logs is really valuable.
117.
▲
by
charleslmunger
2y ago
I'm far from an expert in formal verification, I probably should be doing more of it than I do. From my two links, the way I've seen formal verification work is to either translate the code line-by-line in an automated or manual w
118.
▲
by
charleslmunger
2y ago
People do that, and find very tricky bugs. One person did it by line-by-line translating C code into TLA+, another by representing the state machine in Coq and checking for predicates validating it in the source. But I don't think a vi
119.
▲
by
charleslmunger
2y ago
Designing the state machine was hard. The implementation of that state machine was not that bad, because I'd spent so much time thinking through the algorithm that I was able to implement it pretty quickly. The implementation difficult
120.
▲
by
charleslmunger
2y ago
This can be really tricky to do. I reached the limit of my brain's working capacity designing a priority inheritance system, and sketched the state machine out in a dot file, visualized with graphviz - this worked really well for reaso
More ›