HNHacker News
TopNewBestAskShowJobs

CHY872

1,379 karma · joined April 8, 2014

submissionscomments
CHY872··on US moves closer to recalling Tesla’s self-driving software
Not quite - GP cites the spectre of Tesla nearly going bust to imply that Musk helped achieve the opposite (extremely healthy company) via dubious, ideally criminal means. It's not entirely based on that, but the implication is there.

Put simply, if Musk only made one controversial call, this comment thread wouldn't exist. The many controversial calls cannot be easily disentangled.

CHY872··on A gentle-ish introduction to worst-case optimal joins
Increasingly databases can get do-overs on bad plans. A micro-level example might be dataflow splitting particularly expensive tasks so as to better parallelize them: https://cloud.google.com/blog/products/gcp/no-shard-left-beh...

Spark will re-run the query planner after doing the map stage of a map-reduce operation so as to leverage the information collected: https://databricks.com/blog/2020/05/29/adaptive-query-execut...

Both examples represent changing parameters about a lower level plan than simply join operators, but the industry is certainly moving in this direction.

CHY872··on 2022 Ford F-150 Lightning Full Review: Electric Truck for the Masses
GP qualifies this as a price of _new_ cars. In the US, ~1/4 of car sales every year are new cars.

New cars are primarily bought by comparatively wealthier people or fleet sales. Less well off people might occasionally buy newer cars, but it’s more common to buy them second hand after 5-10 years of careful ownership. The $40k truck has historically depreciated by around 40% during that 5 year period, by which point it’s worth about $24k. Better examples may be worth more, worse examples less (although perhaps a poorer buy). Large examples of this come through age - in the US, the median new car buyer is in their 50s, whereas the median American is in their 30s.

Put simply, yes, the average new car is unaffordable for the average American, but how much of a problem is that?

Out of buyers in the market for a new car, this is clearly close to the affordable side of the range, no matter how ridiculous that might sound.

CHY872··on Using Java's Project Loom to build more reliable distributed systems
For any future readers, I think this is the bug: https://bugs.openjdk.java.net/browse/JDK-8281642
CHY872··on Using Java's Project Loom to build more reliable distributed systems
What’s the missing piece?
CHY872··on Using Java's Project Loom to build more reliable distributed systems
The JVM is a master of gradually closing the gap. Over the last decade:

- Garbage collectors have required far less tuning; with G1, Shenandoah, ZGC it's likely that your application will need little tuning on normal sized heaps.

- modules, jlink etc allow one to build a much smaller Java application by including only those parts of the JVM that one needs.

- Graal native images are real. These boast a far lower startup overhead and much lower steady state memory usage for simpler applications.

Probably my counterexample of choice is this: https://github.com/dainiusjocas/lucene-grep - it uses Lucene, one of the best search libraries (core of Elasticsearch, Solr, most websites), which is notoriously not simple code, to implement grep-like functionality. In simple cases, they demonstrate a 30ms whole process runtime with no more than 32MB of RAM used (which looks suspiciously like a default).

The JVM is fast becoming a bit like Postgres... one of those 'second best at everything' pieces of tech.

CHY872··on Using Java's Project Loom to build more reliable distributed systems
Agreed. And the pluggable scheduling is still a key part of it, just doesn’t need to be a thing to get right out of the gate. I’m honestly mega excited that Loom is even a real thing that exists and that you can use.
CHY872··on Using Java's Project Loom to build more reliable distributed systems
This blogpost does rely on plugging in an executor. While the API was removed, it’s one private variable away (documented in footnote). As you say, it seems like it’s an ‘on the way, but later’ thing - the last Loom preview I used (a while ago) actually had the API so when I started drafting this post I was unhappily surprised!
CHY872··on Using Java's Project Loom to build more reliable distributed systems
What sort of performance characteristics does Cassandra see from its implementation? I was fairly impressed with the 2.5M context switches per second (a fairly random unit, I know) I saw from virtual threads.

Have you found that the approach has made it easier for you to ship improvements to Cassandra?

CHY872··on If You’re Getting a W-2, You’re a Sucker
How would the bonds be paid for if not for taxes? (Genuine question. Printing money?)
CHY872··on Orchestral musicians have unusually challenging jobs
The financing can be complex, but broadly there are a few things that enable modern American orchestras to survive.

1. Benefactors who give money to the orchestra, rent boxes, etc. 2. Popular (non classical) concerts which have a possibly larger crowd and varied material. Harry Potter with orchestral accompaniment? Tenacious D with orchestral accompaniment? The musicians hate it, it pays the bills. 3. A mostly part time staff. Most orchestral musicians will play in many orchestras, teach, etc.

They made a loss on your concert. But they knew they would.

CHY872··on Oracle's JDK 17 – Free Again for Commercial Use
There are some differences that each of the vendors adds in or removed. For example… Oracle Java does not include Shenandoah GC but all of the other distributions do. Azul Zulu Java 8 backported Java 11’s JFR while Oracle that code is behind the commercial flag.
CHY872··on Oracle's JDK 17 – Free Again for Commercial Use
Is this the same degree of testing you apply each time you upgrade you JDK?
CHY872··on Uber is revoking CA drivers ability to set prices and preview destinations
Because someone convinced them to lease or buy on finance a brand new Prius and they need to make payments? That’s where I suspect the exploitation comes in - not the actual Uber usage, but the financial decisions required to get started (eg drive late model car). Vs other apps, they’re all the same give or take a few months.
CHY872··on Go modules have a v2+ problem
It’s traditional at least with web browsers to not send the fragment to the server. Query param would work, but implies your routes don’t change much between major versions.
CHY872··on Overriding C++ virtual functions at run time
ASM is far lower level than ByteBuddy. To write some ASM code you probably want to have some proficiency with the bytecode format itself (e.g. you're typically outputting individual JVM bytecode instructions ;(invokespecial,athrow,etc). Personally I'd probably always use ByteBuddy unless I had some very specific reason why not. For comparison, these two examples https://github.com/raphw/byte-buddy#changing-existing-classe... http://web.cs.ucla.edu/~msb/cs239-tutorial/ explain how to do a System.out.println wrapper around a method.

In one case, the developer writes `System.out.println`. In the other, the developer must individually get the static field System.err and push it to the stack, reference PrintStream's method println, including the arguments (Ljava.lang.String;)V. That means it takes an array of strings and returns void.

CHY872··on Overriding C++ virtual functions at run time
It's generally possible to rewrite loaded classes. Some changes are possible (e.g. replacing a method's body), others are not (adding new methods). The state of the art library for doing this at the application layer is ByteBuddy https://github.com/raphw/byte-buddy#changing-existing-classe... but this functionality is used by plenty of tooling - profilers such as YourKit rewrite methods to add telemetry - I've seen some security libraries attempt to add additional security related hooks.
CHY872··on Cabin releases 2nd-gen fleet of sleeper bus from SF to LA and back
Bullet trains are sadly not maglev. They actually don't go _that_ fast (180-200MPH-ish is common), but look incredibly sleek compared to European high speed trains due to the aerodynamics of dealing with the large number of tunnels that Japan has.
CHY872··on OpenBSD disables Intel's hyperthreading due to security concerns
Thanks! Yeah figured I'd be wrong somewhere in there!
CHY872··on OpenBSD disables Intel's hyperthreading due to security concerns
Your processor has a certain number of execution units which can actually execute individual instructions, maybe like 4 floating point units, maybe 8 arithmetic ones, and maybe 1 that can do vector processing (these numbers are not real, but are like, good enough for sake of message).

So the idea with SMT is that most of the time, lots of the execution units are unused because the thread a) isn't using them at all (e.g. a process to do encryption won't use the floating point units) and/or b) can't use them all because of how the program's written (for example, if I say 'load a random memory address, then add it to a register, then load another random memory address, then add it, etc' I'm going to be spending most of my time waiting for memory to be loaded.

SMT basically means that you run another program at the same time, so even if the encryption process can't use the floating point units, maybe there's another process that we can schedule that will.

However, imagine my encryption process can use 6 of the 8 arithmetic units. If I have 2 encryption processes scheduled on the same core, I have demand for 12 when there are only 8. So now I have contention for resources, and I won't see a speedup from using SMT.

Other comments mention registers and not execution units: I'm suspicious of this, since modern processors have many registers (for Skylake, 250+) which they remap between aggressively as part of pipelining. Maybe this is different for the SIMD units.

That said, I haven't looked at this stuff since university so could well be wrong on the execution unit vs register comparison.

CHY872··on Microsoft disables Spectre mitigations as Intel’s patches cause instability
I have! We had a log shipping daemon that wasn't always releasing its file handles properly and kept taking out applications due to out of spacing the box. That said, I drastically prefer the Unix behaviour.
CHY872··on FLAC 1.3.2
basis of your residence
CHY872··on Java REST framework Dropwizard 1.0 released
I can see that. We found that if we added the Spotify Docker Client to our test classpath we couldn't run the application from Eclipse anymore because our Jackson object mapper had the wrong Jersey modules.

This was because that package depends on a different version of jersey-jackson or whatever, which was discovered by classpath scanning, and so because Eclipse doesn't keep a separate test classpath, we'd be discovering a new MessageBodyWriter which Jersey would be using to override the Dropwizard supplied MessageBodyWriter, which would not have the appropriate Jackson modules.

It was a mess.

CHY872··on Java REST framework Dropwizard 1.0 released
(opinion: i've spent a year writing Dropwizard based apps, but only two evenings writing Spark based apps).

I think that Spark comes at the cost of customisability - 2-way SSL is a chore, you have to parse your own message bodies, you don't get straightforward logging out of the box - there's a base set of features and functionality that I couldn't find in Spark.

The thing that impressed me about Dropwizard is that you can get in perhaps 50 lines of boilerplate a really solid core behind an application - with Spark you can do that in perhaps 20, but you are somewhat limited beyond that.

CHY872··on An event bus framework for event driven programming
Generally you would log with placeholders, like

    logger.debug("My logger message has placeholders {}, {}, {}", some, objects, toLog);
which avoids the issue.
CHY872··on An event bus framework for event driven programming
Fyi, intended usage with most Java loggers is to just call

    logger.debug("...");
and ignore the conditional. If `!logger.isDebugEnabled` then the logger will ignore the message, so it avoids boilerplate.
CHY872··on Show HN: BedquiltDB – A Mongo-like JSON doc store built on Postgres
So, I haven't used Mongo, but here's a list of things I found to be bad about jsonb (use case was a project where we need to be able to quickly aggregate over large numbers of items with small-cardinality metadata):

1. Can't sort using a GIN index.

2. Stats are shit with GIN indices - Postgres assumes that every filter has 100 matches, every array has 99 elements or something. Usually this works well, sometimes (specifically in my case) it's terrible. Specifically, it means that if you combine an aggregation over a GIN filter with an inner join, the performance will be awful because postgres picked a nested loop join for expected 100 results instead of a hash join for the actual 50,000.

3. This also means that additional expression indices you add basically aren't getting used, because it'll always appear better to the query planner to use the GIN index first. This includes things like sorting.

4. Because of how jsonb is implemented (basically arrays containing fields ordered by key alphabetical), we discovered that we were taking out more and more fields out of our jsonb field and placing them in other columns, which kinda missed the point of it (but was very good that we could do so, yay relational data model).

5. Sorting can become an epic chore if you don't have stuff like enum types etc, especially when you try to combine it with tsvectors.

So, very happy with Postgres, but don't slam people who don't use Postgres because of insufficient json support - because Postgres' json support although excellent has quirks that will bite you with certain use cases. Very good, but not a panacea.

CHY872··on British authorities demand encryption keys in case with “huge implications”
I don't buy that. For stuff like key derivation, there are loads of ways you could vary the process without compromising security.

For example, a normal disc encryption system with the caveat that the password is XORed with a secret before the key derivation algorithm is used (where the secret is unique to the exact laptop model) would effectively stop all decryption in its tracks until you knew the exact laptop model, but would not compromise security at all.

CHY872··on Stop forcing arbitrary password rules
No. They are not superior to passwords - they merely provide different tradeoffs. For example, the site that requires your hypothetical key-type key would require that either all of their customers have spent money on such a key (bad) or that they are willing to pay for keys for all of their customers.

This is something that has been thought about in detail - see https://vtllf.org/blog/ssh-web-sign-in/quest-to-replace-pass... for Stajano's analysis.

CHY872··on LibreSSL, and the new libtls API
How about big-endian x86, in case anyone makes a processor that operates that way? At least OpenSSL is ready!
← PreviousPage 4 of 18Next →