Better HN
topnewbestaskshowjobs
Log inSign up

ComputerGuru

32,383 karma · joined Jan 3, 2008 (18y ago) · 8,295 submissions

mqudsi on most sites.
Submissions

comment 1y ago · link · parent

Are their ghostty builds statically linked by default or does zig follow in the footsteps of the C/C++ world and dynamically link everything? If statically linking (like rust) then a huge part of the incremental build times for apps with external dependencies is the lack of incremental linking in any of the major linkers. Wild linker is working on becoming the answer to this: https://github.com/davidlattimore/wild

comment 1y ago · link · parent

A well-written JOIN against a well-designed database (regardless if we're talking postgres, SQLite, MySQL/MariaDB, or MS SQL) should not be slow. If it's slow, you're using it wrong.

comment 1y ago · link · parent

This plagues (plagued?) pretty much everything to do with WordPress, from core to every theme and plugin developed.

comment 1y ago · link · parent

Well, yes, I omitted anything that may or may not happen to explain the general principle. Cardinality-based optimizations can and do take place, but they depend on the db being aware of the shape of your data (you need to analyze the tables often) and depend on internal factors and heuristics that are subject to change between releases, can't be assumed across different databases, and may or may not actually speed up the query (pathological cases certainly exist, even in the real world).

comment 1y ago · link · parent

It's a flattened tree, and you've used the index to reach a point where you have multiple child nodes that meet the precondition thing_date < 17. Some, but not all, of these have thing_color = blue, but the important part is that they're non-consecutive (the index can only give you one point-of-entry, so the data has to be consecutive or you need to do some amount of scan).

I asked an llm to give me an ascii representation so it'll be easier to see what I mean; consider the case where you want thing_date < 17 and thing_color = blue, the results that match are marked with an asterisk, but note that there's no way to get to them (ALL of them) directly:

           Root (internal)
           +---------------------+
           | keys: 14     17     |
           +----+--------+--------+
                |        |        |
                v        v        v
   +----------------+ +----------------+ +----------------+
   | Leaf P0        | | Leaf P1        | | Leaf P2        |
   | (dates 10-13)  | | (dates 14-16)  | | (dates 17-20)  |
   |----------------| |----------------| |----------------|
   | 10 | red   |101 | | 14 | blue  |141| | 17 | green |171|
   | 11 | blue  |111 |*| 14 | red   |142| | 18 | blue  |181|
   | 12 | green |121 | | 15 | yellow|151| | 19 | red   |191|
   | 13 | red   |131 | | 16 | blue  |161|*| 20 | green |201|
   +----------------+ +----------------+ +----------------+
Go back to my resume's example: you have the resumes sorted by application timestamp (chronologically) and position (alphabetically). You want to find all resumes received last Tuesday where position was "Senior Architect". You literally can't skip to the point where the next n consecutive results will be the results you seek, because you can't temporarily re-order them and within the subset of resumes where date > monday and date < wednesday, there may be multiple for "Senior Architect" but they didn't arrive one-after-the-other so they're interspersed with results you don't want. The correct to do here would be (if this is always the shape of the query you expect to get) to sort the resumes by (position, timestamp) instead, at which point you absolutely CAN jump to the position that guarantees the next results are (all the results) of the query ("Senior Architect", last Tuesday).

One important thing to keep in mind is that a SCAN is not the end of the world. You know your data and you know when it's ok (you expect most of the results to match and a few to be filtered out, in which case you're really not saving much time anyway) and when it's not (the scan will cover a huge range that contains only a few, widely interspersed results and you have no way of terminating early).

EDIT: In response to your exact question however, note that with a covering index you might not end up with a SCAN (i.e. you don't hit the table) even though it uses only the partial index (thing_date) and not (thing_date, thing_color)! It's still possible for it to avoid hitting the backing table and might return the results directly from the index - something it wouldn't have been able to do if the index was only (thing_date).

comment 1y ago · link · parent

Not a great article; I clicked expecting something super technical about SQLite internals and found a mix of rdbms basics and some misconceptions. The limitations in the blog post aren't really specific to SQLite (for the most part), they're just how indexes (indices) and database engines work across the board. And some of the things phrased as "SQLite [can't] do this" is stuff that wouldn't make sense to do in the first place.

If you understand what (multi-column) indexes are at the lowest level (i.e. what data structure they represent, how they are used by the database, what the code reading them would look like) then all of this makes immediate and natural sense. Indexes aren't magic. They're just a shortcut to help the the db engine find your data more effectively.

This doesn't require super complex understanding of data structures, btw. The same limitations and advice would apply if you were trying to, for example, search a stack of resumes sorted by one or more attributes. If you have them sorted by position, years of experience, and applicant's last name; you wouldn't be able to quickly grab all resumes for the HR Manager position that have a last name starting with J - after all, you sorted them by years of experience first! It's physically not possible! You can only use the first part of that index, the position, to jump to HR Manager resumes; then you would need to manually go through them one-by-one to grab only the ones starting with J for each years-of-experience subgroup (if any).

comment 1y ago · link · parent

Great job, Vicente and Michael!

* I love the writing, it's witty and poignant

* I was impressed that WASD controls worked with my keyboard set to Dvorak :)

* Unfortunately have to second the comments about nausea; the oddly paced camera (it feels like it is panning through molasses then suddenly accelerates to switch views) is probably responsible, I'm guessing the "overshoot view then correct" "feature" is also a factor. Additionally seconding the comments about allowing the camera to follow the mouse (if feasible somehow while not losing cross-form-factor support) would go a long way to help here as well.

* The font that shows you where you are is cute in an orientalist sense, but imho it is very difficult to read (even knowing what it says from context clues and previous hints)

* Not a criticism but it is odd to have jumping when there is no mechanism that uses it in-game

* 99.99% a me problem: I had a hard time with spatial awareness and a difficulty building a mental map of the world and my best guess is that it's because I personally found the default field of view to be too "zoomed in".

comment 1y ago · link · parent

I think the article could use more on the cache invalidation and write-through (?) behavior. Are updates to the same file batched or written back to S3 immediately? Do you do anything with write conflicts, which one wins?

comment 1y ago · link · parent

Thanks for pointing that out, TIL!

comment 1y ago · link · parent

I don't like relying on (release-only) llvm optimizations for a number of reasons, but primarily a) they break between releases, more often than you'd think, b) they're part of the reason why debug builds of rust software are so much slower (at runtime) than release builds, c) they're much harder to verify (and very opaque).

For non-performance-sensitive code, sure, go ahead and rely on the rust compiler to compile away the allocation of a whole new vector of a different type to convert from T to AtomicT, but where the performance matters, for my money I would go with the transmute 100% of the time (assuming the underlying type was decorated with #[transparent], though it would be nice if we could statically assert that). It'll perform better in debug mode, it's obvious what you are doing, it's guaranteed not to break in a minor rustc update, and it'll work with &mut [T] instead of an owned Vec<T> (which is a big one).

comment 1y ago · link · parent

You misunderstood the purpose of that trick. The vector is not going to be accessed again, the idea is to move it to another thread so it can be dropped in parallel (never accessed).

comment 1y ago · link · parent

Ok, so if not 2.6 then 2.5.1 :)

comment 1y ago · link · parent

I wonder if you used their image editing feature if it would insist on “correcting” the number of limbs even if you asked for unrelated changes.

comment 1y ago · link · parent

I’ve used this but it made my laptop spontaneously reboot a few times (or was it a hard lockup that necessitated a reboot)? I liked it but ended up putting it away.

Dual GPU nvidia and integrated Intel, was running the latest Ubuntu LTS at the time with all updates.

comment 1y ago · link · parent

What’s a user-friendly mouse friendly modeless cli text editor you can compile to wasm?

comment 1y ago · link · parent

Great work and nice write up, Ash!

A suggestion: in the comparison table under the “AES and Port-Parallelism Recipe” it would be great to include “streaming support” and “stable output” (across os/arch) as a column.

Also something to beware of, some hash libraries claim to support streaming via the Hasher interface but actually return different results in streaming and one-shot mode (and have different performance profiles). I’m on mobile so I can’t check atm but I’m about 80% sure gxhash has at least one of these problems that prevented me from using it before.

comment 1y ago · link · parent

Framing it in gigawatts is very interesting given the controversy about skyrocketing electric prices for residential and small business users as a result of datacenters over the past three years, primarily driven by AI growth. If, as another commenter notes, this 10GW is how much Chicago and NYC use combined, then we need to have a serious discussion about where this power is going to come from given the dismal status of the USA's power grid and related infrastructure and the already exploding costs that have been shifted to residential users in order to guarantee electric supply to these biggest datacenters (so they can keep paying peanuts for electricity and avoid shouldering any of the infrastructural burden to maintain or improve the underlying grid/plants required to meet their massive power needs).

I'm not even anti-datacenter (wouldn't be here if I were), I just think there needs to be serious rebalancing of these costs because this increase in US residential electric prices in just five years (from 13¢ to 19¢, a ridiculous 46% increase) is neither fair nor sustainable.

So where is this 10GW electric supply going to come from and who is going to pay for it?

Source: https://fred.stlouisfed.org/series/APU000072610

EDIT:

To everyone arguing this is how DCs are normally sized: yes, but normally it's not the company providing the compute for the DC owner that is giving these numbers. nVidia doesn't sell empty datacenters with power distribution networks, cooling, and little else; nVidia sells the GPUs that will stock that DC. This isn't a typical PR netnewswire bulletin "OpenAI announces new 10GW datacenter", this is "nvidia is providing xx compute for OpenAI". Anyway, all this is a segue from the question of power supply, consumption, grid expansion/stability, and who is paying for all that.

comment 1y ago · link · parent

Any time looking at the RO data directly triggers a need to edit it. Eg, you notice a typo or a mistake, you get the idea for a follow up or clarification, etc.

comment 1y ago · link · parent

All this praise for the titanium casing makes it a real bummer that the Pro has been downgraded to aluminum.

comment 1y ago · link · parent

I’m intrigued but that is one of the worst (least technical) product pages for a very technical product that I’ve come across. My biggest concern was that it has no mention of compatibility, it just says it connects to the smart meter via zigbee but aside from the obvious fact that zigbee is just the network protocol and does not necessarily mean all smart meters use the same layer 7 details, I don’t even know if my smart meter has zigbee to begin with! Ah, I just found a FAQ page for the site not linked from the product page that answers the compatibility question.

Also, I wouldn’t have known the product exposes an API I could use to programmatically get the (XML-only?) usage data in realtime over the network if you hadn’t told me, the product listing makes it look like it’s just a screen (and the faq doesn’t have anything about connecting to the device programmatically).

Anyhow, thanks for brining this to my attention! This might be exactly what I was looking for!

comment 1y ago · link · parent

I am in a unique position to confirm that they are a load of bunk. I have solar urticaria and develop hives in response to UV exposure, directly proportional to how much UV is getting through. I’ve developed hives in minutes while the UV index was supposedly only 4 and gone for relatively too long without erupting in hives the next day even when the UV index was supposedly 10.

comment 1y ago · link · parent

I don’t have a LinkedIn and it has impaired my job hunts in the past but I always worry that creating one now (without the references of colleagues from decades of past work) would look worse than not having one?

comment 1y ago · link · parent

Guys, don’t take the claim so literally. He’s a successful tech poster. He makes good money showing off his purchases the good money complaining about how expensive they were.

But certainly don’t imitate his choices, his economics aren’t your economics!

comment 1y ago · link · parent

Only if it’s a 1U. 2U units idle at silent.

comment 1y ago · link · parent

What is performance per percent?

comment 1y ago · link · parent

> okay, looks like there is a way but it's really convoluted and you need to basically jump-start the low voltage system

So what you're actually saying is, there really isn't a (sane) way after all.

comment 1y ago · link · parent

People are commenting about issues loading the images leading to them abandoning reading the article. Here is a fully cached copy of TFA, but note that the videos (and images, but especially the videos) load _really_ slowly https://web.archive.org/web/20240317122351/https://blinry.or... (but they do load if you wait long enough).

comment 1y ago · link · parent

Yes, that seems to be what mine is doing as my ecobee thermostat is able to read info about peak usage times from the mains. I didn't know about the latter part though, I never imagined electric companies were making a play for the internet (though it seems like an obvious thought in retrospect).

comment 1y ago · link · parent

I was informed maybe 7 or 8 years back that my electric company would be replacing my analog meter with a smart one and always intended to try and glean more information about my electric consumption habits from it. It took me a lot longer than I intended, but last year I finally bought an RTL-SDR in the hopes of being able to get realtime info from the meter. Unfortunately, it seems that it's not one of the ones that emits consumption info over ISM bands for consumption by household appliances (so far as I can tell) and I ended up only capturing info from TPMS sensors off of passing cars (which was cool, but not really what I was looking for).

Do note that if you purchase an RTL-SDR these days, you'll probably get a v4 which, at least as of last year, does not play out-of-the-box at all with the software available on the Ubuntu apt repos and the RTL-SDR drivers that ship with 24.04 out-of-the-box — there were some hardware protocol/interface changes between v3 and v4 that make the old drivers incompatible and you'll get a litany of misleading or non-specific errors if you try without downloading and installing the latest drivers from GitHub (or somewhere).

1
131415
277