Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pkhuong
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
17 ms
·
151.
▲
by
pkhuong
11y ago
Fixed, thank you!
152.
▲
by
pkhuong
11y ago
That's just bad mental arithmetic on my part. Fixed!
153.
▲
by
pkhuong
11y ago
> Intel's comparable 11 bit precision vectorized log function performs about 6 times faster at lengths of 64k or longer. The issue is probably the division in the approximation. Agner Fog says even Sandy Bridge doesn't pipeline
154.
▲
by
pkhuong
11y ago
It's an interesting trade off; you get a nice bump in precision for a small increase in code complexity.
155.
▲
by
pkhuong
11y ago
For values far from 1, log_2 will be dominated by the integer portion, which IEEE FP representation gives you for free, so it's not surprising that outputs eventually look right. I think the problem is that the approximation works with
156.
▲
by
pkhuong
11y ago
In operations research, it's common to stop when a solution is provably within 1e-4 of optimum. Off the top of my head, reasons include: we don't want to optimize FP error, limited precision in the input data, and negligible real
157.
▲
by
pkhuong
12y ago
There is no special call stack manipulation in the CL condition system. It's built on top of dynamic scoping and normal catch/throw unwinds; see http://www.pipeline.com/~hbaker1/MetaCircular.html for block&#x
158.
▲
by
pkhuong
12y ago
Looks like PICBIT is finally open source: https://github.com/stamourv/picobit We use(d?) it at U of Montreal to drive small PIC18 robots. Except for the one time I had to debug its GC, it was a fine platform, even for
159.
▲
by
pkhuong
12y ago
I hear Clozure works well on Windows (64?).
160.
▲
by
pkhuong
12y ago
That's a good one for integers and if you don't intend the comparator to be inlined. For inlined comparison, I prefer if (x == y) return 0; return (x < y) ? -1 : 1;. The control flow is more transparent and C compilers are usua
161.
▲
by
pkhuong
12y ago
"It is a research project which aims to apply the pure and dependently typed Coq language to system programming, with inputs/outputs and fine grained concurrency in mind. … We try to develop new programming techniques with an extr
162.
▲
by
pkhuong
12y ago
That's exactly the kind of optimisation that I had in mind. What I'm saying is that the static analysis would work the same even if memcpy was implemented by jumping to memmove or some linker trick to make it resolve to memmove.
163.
▲
by
pkhuong
12y ago
Right… you have to check cpuid for the long nop feature. I believe 0x66 0x90 is compatible (but slow, I would expect) with older CPUs.
164.
▲
by
pkhuong
12y ago
https://github.com/sbcl/sbcl/blob/master/src/compiler/x86-64... has 0x66 0x0f 0x1f 0x84 0x00 0x00 0x00 0x00 0x00 That's a size override prefix, followed by the dedicated NOP instruction (0
165.
▲
by
pkhuong
12y ago
Long nops would be marginally quicker.
166.
▲
by
pkhuong
12y ago
Aliasing optimisations will fire regardless of how memcpy/memmove are implemented.
167.
▲
by
pkhuong
12y ago
I'm considering Phis for production workloads, and getting the test unit was never an issue. However, I also have some hobby projects that might work well on Phis. There's always the argument that personal projects are preparation
168.
▲
by
pkhuong
12y ago
True, if you're out of cache, there's a goldilocks zone where linear search works better. I mostly disregard that because *chotomic search is equivalent/quicker in cache and for small arrays, and quicker for large arrays.
169.
▲
by
pkhuong
12y ago
I had two points in that post. The first, obvious, one is that binary search can be micro-optimised to combine decent algorithmic properties with an enviable constant factor. The second one is that, when linear search outperforms binary sea
170.
▲
by
pkhuong
12y ago
How would you test for bad sequences? Does that method manage to flag http://en.wikipedia.org/wiki/RANDU ?
171.
▲
by
pkhuong
12y ago
If you see code compile to a full mfence in CK, please tell us. In my experience, there is no concurrency-related related reason to use mfence on x86. In fact, you'll see that we have code that checks for x86oids and use an atomic RMW
172.
▲
by
pkhuong
12y ago
re sfence: standard x86 memory ordering forbids store/store reordering anyway.
173.
▲
by
pkhuong
12y ago
The fun thing about membars on x86 is that, unless you're playing with nontemporal stores or non-standard memory types, LOCKed ops are more efficient fences than mfence.
174.
▲
by
pkhuong
12y ago
1. It has O(1) lookups (it has to probe at most 2 constant-size buckets) and O(1) amortised insertions (the probability of needing more than k swaps to find an empty slot decreases exponentially with k). 2. It's geared for low false po
175.
▲
by
pkhuong
12y ago
Fixed-width binary data (e.g., a sequence of double floats) often benefit from a simpler transform: just transpose the bits/bytes so that, e.g., the least significant bytes form a contiguous region, followed by all the second least sig
176.
▲
by
pkhuong
12y ago
There are several kinds of nondeterminism. In the case of nondeterministic complexity classes like NP, it's angelic nondeterminism: whenever the algorithm makes a non-deterministic choice, the machine obeys an oracle that will guide it
177.
▲
by
pkhuong
12y ago
CLISP doesn't use GMP; it has its own, very nice, bignum library. If you want to use GMP on SBCL, the SB-GMP contrib has been around for approximately one year; it'll hook transparently in SBCL's bignums, at runtime. However,
178.
▲
by
pkhuong
12y ago
Fast(er) persistent arrays are easier than purely functional ones. See Baker's Shallow Binding Makes Functional Arrays Fast ( http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.47.3... ). The problem with impur
179.
▲
by
pkhuong
13y ago
Thanks for the heads up on the scan! That's what I get for publishing just before rushing to dinner. The blog is just a bunch of static files, so there shouldn't be any issue. This situation is really annoying; I'll figure so