Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dzaima
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
51 ms
·
781.
▲
by
dzaima
3y ago
I'm reading it as the ex-employee thinking that the company might not want to respond, and choosing to do so despite that, on the grounds that it should be acceptable to do so (i.e. the ex-employee couldn't be publicly "scold
782.
▲
by
dzaima
3y ago
I imagine the comment about less being "annoying" to show is just about conveying the interactive TUI in an unchanging plain-text form, given that the terminal wouldn't ever contain both the invocation and the output. And the
783.
▲
by
dzaima
3y ago
Lucene here just dealing with plain float[]s, so Valhalla at least shouldn't affect it much. It seems the limiting thing here is that it has sum accumulators, which the optimizer can't reorder because addition isn't associati
784.
▲
by
dzaima
3y ago
A little confusing because "vector" here (largely) refers to two different things. "Vector search" being this ANN thing, but the "Vector API" is about SIMD. SIMD provides CPU operations on a bunch of data at a
785.
▲
by
dzaima
3y ago
If it's old, even with emulation it'd have a good chance to be as fast or faster than on its original target chips. So you'd need to not only rely on it, but also be demanding more from it over time. And given that you'r
786.
▲
by
dzaima
3y ago
With a simple enough allocator, freeing things could maybe even be beneficial even for short-lived programs, purely from the memory being in cache already, instead of needing to ask the OS for more (incl. page faulting & zeroing, beside
787.
▲
by
dzaima
3y ago
APL doesn't do this character arithmetic; BQN does. But it's not weak typing, it's an intentionally designed feature[0]; so things like "a"+1.2 or "a"+"b" error. It's quite useful too - you
788.
▲
by
dzaima
3y ago
BQNPAD can also use CBQN via the VM dropdown at the top right (but CBQN doesn't support live previewing unlike BQN.js). Also, "Big Questions Notation", not "Query". Not that it matters much.
789.
▲
by
dzaima
3y ago
And then there's the question of how you use the epsilon - i.e. whether 1.2e-16 and 1e-20 are "within 1%". Sometimes those are very much different sizes, but if you're comparing sin(π) (i.e. the 1.2e-16) with some other
790.
▲
by
dzaima
3y ago
By "large" I mean compared to the fraction of needs-slow-emulation things present currently in C (which is currently approximately zero, other than using integer/float types unsupported on the target hardware (and maybe multi
791.
▲
by
dzaima
3y ago
Yeah, I've seen it! https://google.github.io/highway/en/master/quick_reference.h... In many cases, yeah, emulating things can be fine, but in others, very much not so. If not doing trivial (i.e. autovect
792.
▲
by
dzaima
3y ago
Ok, prefetching is a thing that could maybe be standardized as a hint, but even then there could be differences in how many bytes apart your prefetches optimally need to be, and what range they'll prefetch (might even be a property of
793.
▲
by
dzaima
3y ago
Cache is a microarchitectural thing. There's no "controlling" it without explicitly knowing the properties of the caches of the running processor (size, latency, associativity, replacement policy, and whatever other quirks th
794.
▲
by
dzaima
3y ago
I'd rather not have a basic feature be put behind needing to define an arbitrary NDEBUG; having to define your debugging setup around NDEBUG would not fit some things - e.g. in my case I'd end up having to always define NDEBUG, an
795.
▲
by
dzaima
3y ago
And you can easily do a macro check and define a custom thing that's either assert(0) or unreachable() depending on the build type. But you still need unreachable() to exist to do that. (and under -fsanitize=undefined you get an error
796.
▲
by
dzaima
3y ago
Here, probably not (with proper arguments at least; without the parens something like `MAX(1;2, 3)` would compile without errors though), but I'm just used to doing it everywhere.
797.
▲
by
dzaima
3y ago
As an example of this, a generic `MAX` macro that doesn't evaluate its arguments multiple times, would be (using said GNU extension of statement expressions): #define MAX(A, B) ({ auto a = (A); auto b = (B); a>b? a : b; })
798.
▲
by
dzaima
4y ago
The question here is about what happens when such an array is part of a heap-allocated struct where there's already a layer of indirection. As far as I can tell, the [..] proposal would effectively be equivalent to pointer & length
799.
▲
by
dzaima
4y ago
Right. Not saying that it'd be hard to support the original code, but more that it's just an extremely weird case to have. As in, I'd say that adding "foo = try { bar(baz) } catch (SomeException ex) { SOME_DEFAULT }"
800.
▲
by
dzaima
4y ago
something like final Foo foo; try { foo = bar(baz); Integer a = null; int b = a; } catch ... (though that's less the assignment, more implicit behavior; point being, you've got quite the restricti
801.
▲
by
dzaima
4y ago
It's because if you had final Foo foo; try { foo = bar(baz); otherFunction(); } catch (SomeException ex) { foo = SOME_DEFAULT; } that'd truly be invalid - the first assignment could run
802.
▲
by
dzaima
4y ago
it can, as was discussed in comments on the video with replies from Tom. IIRC, the source code has been updated to use that instead.
803.
▲
by
dzaima
4y ago
There are quite a few of these apparently. https://topaz.github.io/paste/ (lzma) from the creator of Advent Of Code, and mine: https://dzaima.github.io/paste/ (pako)
804.
▲
by
dzaima
4y ago
"dzaima" is how I prefer to be referred to as; but that list is largely me going off of memory, definitely worth double-checking. (and of course, they're ≤AVX2-specific, i.e. x!=y does exist in avx-512 (and clang can do movem
805.
▲
by
dzaima
4y ago
Stay within 16-byte lanes for many things (≤16-bit element shuffles, truncation, etc); use saturating when narrowing types if possible; try to stay to a==b and signed a>b by e.g. moving negation elsewhere or avoiding unsigned types; swit
806.
▲
by
dzaima
4y ago
> I've found that even emulating missing vector functionality is usually still faster than entirely scalar code. inefficient SIMD can still be better than scalar loops, yes, but better than that is efficient SIMD; and you may be abl
807.
▲
by
dzaima
4y ago
When writing "generic" code you still want to consider the target; for example, while it may semantically be nicer to use masking everywhere, doing so is pretty bad for perf pre-AVX-512 (especially for loads/stores, which jus
808.
▲
by
dzaima
4y ago
And sanitizers that throw warnings on undefined behavior do indeed exist.
809.
▲
by
dzaima
4y ago
The example here doesn't have compile-time known undefined behavior though; as-is, the program is well-formed assuming you give it safe arguments (which is a valid assumption in plenty of scenarios), and the check in question is even k
810.
▲
by
dzaima
4y ago
yep, hence why calling conventions usually have both callee-saved and caller-saved registers, so that you only have "unnecessary" stack usage when you need to use more than roughly half of the registers.
More ›