Better HN
topnewbestaskshowjobs
Log inSign up

foxhill

1,320 karma · joined Jun 2, 2011 (15y ago) · 523 submissions

Submissions

comment 4d ago · link · parent

i can’t remember which front end it was, but one of the places i worked with was having all the comments stripped out of the queries before they were sent over the wire.

it was a nice surprise to find out that hinting had just.. never worked.

comment 4d ago · link · parent

plan hinting is a crutch. a useful one to have, and lifesaver when you need it, but a crutch nonetheless.

what i wish postgres would do is to replan when it wildly mis-estimates row counts in deeply nested queries. just because you decided on a linear scan join when you thought that sub-query had 4 rows, doesn’t mean you need to commit to it when that sub-query turns out to actually have 4 million rows.

if you need query plan hints, it’s most likely because some aspect of postgres’ statistics about your tables is very out of line. and, given the very nature of stats collection, i.e., it being a lossy process, there are many distributions of data that it simply cannot detect & accurately account for.

comment 1w ago · link · parent

obviously not by the pallet. but you wouldn’t fill a ford transit van.

comment 1w ago · link · parent

~150 GPUs (presuming 80k usd per card). would fit in a sedan.

comment 2w ago · link · parent

what has this got to do with rust?

comment 2w ago · link · parent

forgive me if i’m wrong. i don’t think you’ve ever had to administer more than a handful of machines. your “fix” is irrelevant.

> That being said there definitely should be an automated way to check for incompatibilities between normal and rust sudo.

yes. it’s called the bare minimum.

comment 2w ago · link · parent

i set up a bunch of machines at my new place. ubuntu.

my weekend project is moving them over to debian.

it pains me, ubuntu used to be “the” linux i would point people to. the “un-fuckup-able” thing people should try if they’re switching.

8.

Native Prometheus Integration with Nginx(categorica.io ↗)

55 points · by foxhill · 1mo ago · 16 comments

comment 1mo ago · link · parent

the resulting topology is somewhat.. violent, no? that said, i wonder how much of an impact it actually has on rendering.

either way, neat stuff, and the write up itself is excellent.

comment 4mo ago · link · parent

i do wonder how something like this can be generally implemented. i presume this must only support a subset of SQL/plpgsql, as some things would be.. utterly insane to manage manually. e.g., if i have a table with a btree-gist overlap constraint, or some inclusion-exclusion check-constraint (or literally any constraint that requires multiple rows to be fully determined - there are quite a lot of them), how on earth does this work?

there's a reason why postgres writing is (mostly) serialised (asterisk) to a single writer (asterisk asterisk). something something ACID, but in short by having multiple writers improves availability, but weakens integrity.

comment 4mo ago · link · parent

that's a nice example. on my M4, i measured 3.4s vs. 0.42s. honestly surprised there's ~10x improvement to be found.

as you've pointed out, you've literally micro-optimised this - isn't this what you'd expect? :)

12.

Trust your compiler: Modern C++(categorica.io ↗)

68 points · by foxhill · 4mo ago · 45 comments

comment 1y ago · link · parent

it probably shouldn’t be a “release” thing. actually, certainly. i do wonder how many bugs would never have seen the light of day, if someone’s “set” actually turned out to be a sequence (i.e. allowed duplicate values) resulting in a debug build raising an assert.

comment 1y ago · link · parent

huh. very cute. in the past, i had an idea for terser lambda syntax, similar to C#'s expression body functions - which i did end up implementing in clang:

    auto sum = [](auto a, auto b): a+b;
but this is something else. i didn't think i'd like it at first, but actually i think i might be coming around to it. the.. dollar syntax is regrettable, although it's not a show stopper.

comment 1y ago · link · parent

you can't be serious, surely?

yes, mozilla's TOS update is a bad thing, but switching to chrome (or chromium-based) for it is really cutting your nose to spite your face.

comment 1y ago · link · parent

you’re conflating reaction times and latency perception. these are not the same. humans can tell the difference down to 10ms, perhaps lower.

if you added 200ms latency to your mouse inputs, you’d throw your computer out the of the window pretty quickly.

comment 2y ago · link · parent

what a miss.

i’d consider myself a day-to-day c++ engineer. well, because i am. i like lots of things from rust. there’s a few things i don’t. c++ has a lot to learn from rust, if it is to continue to exist.

but really.. isn’t this the point of the language? you need to understand the borrow checker because.. that’s why it’s here?

maybe i’m missing something.

comment 2y ago · link · parent

friends. you understand that you can just.. take it off, right?

fully unscrew the cap then just either continue twisting the cap over the the edge - honestly effortless - or just.. pull it off? the cap still functions as a cap, afterward.

apologies, but i don’t understand the furore over this change.

comment 2y ago · link · parent

so, when do you want to die, then?

really, i’m not trying to be mean here. you assert life must be finite, and all i’m asking is how finite it should be.

comment 2y ago · link · parent

apologies, i wasn't being specific; none of what i said necessitates a CRT display, it was only as an example of how an older technology had less latency.

if modern a modern 60Hz LCD/OLED display couldn't get beneath 16.6ms latency, then what exactly is tearing?

comment 2y ago · link · parent

you don't need to "beam race" to achieve sub-frame latency - you don't need to be accurate. switching off vsync should, principally, be enough to achieve this.

otherwise, yes, modern APIs go out of their way to avoid the possibility of this (the dreaded "tearing" artifacts you see from the frame buffer being changed during the transmission of the video signal to the monitor). i don't believe older techniques like you've mentioned are at all possible today, and only really made sense to talk about when analogue displays were the norm.

comment 2y ago · link · parent

> An application with 10 frames of latency will be faster on a 1 kHz display than a perfectly coded application on a 60 Hz display.

thats actually not true. you seem to be implying that the best a 60hz display can manage is 16.6ms of latency. indeed that is the worst case value, but you should consider that early graphics technologies involved changing display modes mid scan.

it’s actually not ridiculous to suggest that old platforms had sub-millisecond latency; they did. if the scanline was on, or just before, the line where you would interact (i.e., the prompt line), the text you enter would appear immediately.

of course, “vsync”, tear free, and such like approaches “fixed” this - necessarily by adding at least a frame’s worth of latency - but also adding perceptual latency.

it’s an oft-overlooked aspect of refresh rates. a 60hz CRT, without vsync, still has the lower bound of latency lower than a 120hz display. perhaps even 240hz.

i’ve used two 240hz displays for years now. i’ll never go slower than that.

comment 2y ago · link · parent

fair enough :) apologies!

comment 2y ago · link · parent

correct me if i’m wrong, but i believe the point that is trying to be made is;

a system user/admin has an intuition about files. saying that ‘journalctl -f -u’ (fu, indeed :) and whatever else is inherently undiscoverable, and is a.. basically orthogonal mechanism for handling what should be a simple task. i.e., viewing some logs. it’s far easier to compose and extend from files (what if i only care about the mtime of the log, for instance), than this.

look, i think systemd isn’t.. terrible. i also think it’s suffered a bit of complexity fetishisation, and it seems as though that this resulting complexity may have become invisible to you.

run0 doesn’t seem like a bad idea. but i am wincing a bit at the thought of unrestricted javascript determining access control.

comment 2y ago · link · parent

yes, that’s what collective health care means, regardless of if it’s state-mandated, or fully private.

you, or i, don’t get to decide what’s fair to treat, or who’s deserving of treatment.

comment 2y ago · link · parent

the (presumably) stateless, serverless function that appears to serve the site has.. crashed?

i dunno, i feel like the wording of this error message could be improved :)

comment 2y ago · link · parent

only if you want to store them in the open air. vacuum sealing them would obviate the need for an expensive hvac bill.

and deep ground is not ridiculous. we’re expecting the storage to be in the “mostly write only” regime, after all.

comment 2y ago · link · parent

i am quite familiar with compiler internals :)

of course, across the TU boundary things get difficult, but i don’t think it’s fair to dismiss LTO entirely (although.. i agree with the thesis that it’s not particularly.. good)

similarly, de-virtualisation is an optimisation technique compilers will aggressively use to improve performance, although you’re right that it can’t look through another source file, so it is not without limitations here.

but we’re not being general, we’re being specific; the safety issues that are being discussed are well within the remit of the c++ type system here, and i don’t think we’re doing any favours to anyone by letting this rvalue be accessed in this way. it is certainly not idiomatic to provide library code that can so violently implode with seemingly regular use. i find it difficult to believe that lifetime issues like this are undiagnosable.

comment 2y ago · link · parent

ah, sorry, i didn’t read that correctly.

perhaps for values like this you’re fine. i think my point still stands about the reader of a built-in list/sequence type, surely?

and, not to sound facetious, that’s exactly what optimisers do :)

the c++ type system is more than capable about reasoning about lifetimes, the issue is that, with c++, it’s an optional part of the language. also, the lack of non-destructive moves. but to require both of those things in the language would require, essentially, the borrow checker in rust.

comment 2y ago · link · parent

i could be wrong, but i’m reasonably confident that this is UB for even trivial types? someone more knowledgeable with the language lawyering would need to opine one way or the other.

regardless of that outcome, i think i’d prefer to require a value preserving the lifetime of the reader/view. in the cases that it may not be necessary, i'd prefer to lean on the optimiser to take care of it..!

12345
18