Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pkhuong
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
121.
▲
by
pkhuong
6y ago
Short writes to (local) filesystems are rare in practice, unless you run into kernel limits (e.g., Linux stops a couple KB short of 2GB). When they do happen, it's often due to issues that are hard to recover from, like failing media o
122.
▲
by
pkhuong
6y ago
I believe the explanation can be found in this screenshot https://twitter.com/pervognsen/status/1353524282291179522
123.
▲
by
pkhuong
6y ago
I switched some in-house database written in C to a variant of UTF-8b where the NUL byte is also surrogate escaped, mostly because of pervasive NUL termination issues as mentioned in the OP. Escaping NULs wasn't the only reason we chos
124.
▲
by
pkhuong
6y ago
mrg32k3a uses double float for integer arithmetic because it was designed (like poly1305) back when computers were mostly 32 bit, and C compilers didn't reliably expose 64 bit operations. It's easy to implement with 32-bit integer
125.
▲
by
pkhuong
6y ago
Circonus ( https://www.circonus.com/ ) supports both recording histogram directly, and merging histograms for analysis. IIUC, it also supports first-class timeseries data similarly to Monarch, where each data point has a high
126.
▲
by
pkhuong
6y ago
> That's an interesting point. What's an example of an application that needs to hash a lot of small inputs, with data dependencies between them? For short inputs, we want to estimate the time that elapses from the moment we kn
127.
▲
by
pkhuong
6y ago
I updated the post to reflect the numbers I get from the native rust implementation's benchmarks (instead of SMHasher's copy of the C code): 66 ns and 5.5 GB/s. However, I don't see any dependency chain between iteration
128.
▲
UMASH: A fast and universal enough hash function
(engineering.backtrace.io)
9 points
by
pkhuong
6y ago
|
4 comments
129.
▲
by
pkhuong
8y ago
Projection functions for pairs, so first/second (i.e., (A, B) -> A, (A, B) -> B).
130.
▲
by
pkhuong
8y ago
Yes, you can do the same thing with set of states. In either case, https://en.wikipedia.org/wiki/Method_of_Four_Russians might be more practical.
131.
▲
by
pkhuong
8y ago
This would definitely work if S didn't produce its output from X. Given that it does, I don't see how the strategy above can implement f(x[0], x[0]) f(x[0], x[1]) f(x[1], x[2]) f(x[1], x[3]) f(x[2], x[4])
132.
▲
by
pkhuong
9y ago
The expressiveness of LLVM IR is very close to C. Given a high enough tolerance for pain, one could implement the same rewrite that the rust compiler would implement in C (without even going into inline assembly). In practice… maybe. Howeve
133.
▲
by
pkhuong
9y ago
From the intro > These techniques are used in the Microsoft Bing search engine, which has been running in production for the last four years on thousands of servers. Compared to an earlier production search engine based on inverted lists
134.
▲
by
pkhuong
9y ago
What if x and y may be assigned, but their evaluation has side effects (e.g., array[i++])? Common Lisp's most interesting contribution to this discussion is that places (~lvalues) are (should be) expressed in a common framework which l
135.
▲
by
pkhuong
9y ago
With any decent optimiser, "full cross-library optimization" is large superset of what tree shaking does.
136.
▲
by
pkhuong
9y ago
The results are approximate (but that's always true), and, IIUC, the quality of the approximation depends on how well the matrix can be factored into a local component (with values inversely proportional to |(i - j)|) and a sparse glob
137.
▲
by
pkhuong
9y ago
For nice enough smooth functions, the minimax approximation can only improve Chebyshev by at most ~2 bits; this http://www.uta.edu/faculty/rcli/papers/li2004.pdf paper shows that the improvement is in fractio
138.
▲
by
pkhuong
9y ago
> 1) The linearly-probed robin hood variant is just a sorted array. That's it. It's just a sorted array. Right. I stumbled on linear probing robin hood hashing as a simplification of Bender, Demaine and Farach-Colton's Pac
139.
▲
by
pkhuong
10y ago
TIL: .NET doesn't expose bitscan instructions.
140.
▲
by
pkhuong
10y ago
If you don't need to store the hash value because your hash function is simple, you don't… Nothing about the (linear) robin hood collision handling strategy forces an explicit representation of the hash value. However, it is true
141.
▲
by
pkhuong
10y ago
My last paragraph says you're probably better off with a solution that doesn't achieve the same density but avoids the uncorrelated accesses. In other words, stick to some form of local probing and take the hit in density. Why wou
142.
▲
by
pkhuong
10y ago
You can have preallocated buckets in an array. What's the difference you ask? When you have more elements per buckets, the variance becomes smaller as a fraction of the bucket's size. Imagine you had a hash table with buckets of 1
143.
▲
by
pkhuong
10y ago
Lookups in cuckoo tables hit two uncorrelated ("random") locations in the hash table. That's not a problem for hardware implementations that can just read from two different SRAMs. On commodity hardware with virtual memory, i
144.
▲
by
pkhuong
10y ago
Why do the authors report performance at O0 and O1? AFAICT, the experiments are all single socket. There's an important difference in coherency overhead for single VS multiple sockets; same for futzing with page protection. It also loo
145.
▲
by
pkhuong
10y ago
http://cacm.acm.org/magazines/2016/3/198849-a-differential-a... 8575 C or C++ packages in Wheezy. This tool found definite UB bugs in 40% of them. How would you know that your code is sometimes misbehaving
146.
▲
by
pkhuong
11y ago
How is it validated? I have yet to discover something more frustrating than debugging a code generation bug that's actually an assembler bug.
147.
▲
by
pkhuong
11y ago
It's when you sample a phenomenon based on events that aren't independent from the phenomenon's value. If you ever tried to profile a locking performance issue with a statistical profiler triggered by CPU time, you've me
148.
▲
by
pkhuong
11y ago
Convenience stuff in the test harness.
149.
▲
by
pkhuong
11y ago
The layout is definitely interesting, but the experiments in that paper are of questionable usefulness. The numbers are for simulated caches (cachegrind), and don't take TLBs into account. They also only consider complete binary trees,
150.
▲
by
pkhuong
11y ago
There's a third (still clunky) option: `#define` parameters before `#include`ing a template file.
More ›