15,561 karma · joined Jun 8, 2017 (9y ago) · 4,715 submissions
comment 5mo ago · link · parent
It's fairly trivial, but still significantly harder than computing a single CRC.
You can do it with a single GF(2) multiplication, ignoring the complications of reflection and such. A normal CRC is just the special case of making the remainder 0 (again ignoring complications). You can also brute force it, but that's a bit slow for 64 bit CRCs and well, nanoseconds vs minutes in your example. Noise is not the only thing they should be protecting against.
Sorry, can you point to the comment where I tried to defend AMD's use of CRCs in this particular application? I think I've made it pretty clear that I don't think they're appropriate for cryptographic applications. I was just talking about the math.Different tools for different purposes. You probably don't want to be using your mac scheme for noise resistance, because then you're paying a cost in either buffer space, PDU size, or retransmits, and your error correction capabilities are nil. CRCs allow some error correction (albeit rarely used and inefficient for multibit errors vs FECs), good bit error detection properties, and are cheap. It's common to use both at different layers of a protocol stack.
comment 5mo ago · link · parent
Nevertheless, they're still useful protection against noise, and you usually want to detect it right as you're pulling protocol messages off the wire. Placing checksums in the last field of each message (as Ethernet does) simplifies the hardware implementation.
comment 5mo ago · link · parent
comment 6mo ago · link · parent
I don't think there's any single language that most serious software is written in.
comment 6mo ago · link · parent
That said, there are clear advantages to books. You can't page through an ebook nearly as well as a physical reference book. That's admittedly somewhat balanced by the existence of search. Physical books can also pay much more attention to the aesthetics of print and layout. Eink readers and epub/mobi/az3 formats are atrocious for this, whereas iPads with PDFs are somewhat better. There's still works that can't be captured in those formats though, like pop-up books, raised/embossed/textured printing (which I've seen used in poetry), or illuminated works. And books don't need power.
comment 6mo ago · link · parent
comment 6mo ago · link · parent
It's exactly as related to real models as computer science is to real computers.
comment 6mo ago · link · parent
comment 6mo ago · link · parent
comment 6mo ago · link · parent
The shogunate needed to do some balancing along the way (including the introduction of metallic currency), but the government had enough levers to keep the samurai in line, right up until they couldn't.
comment 6mo ago · link · parent
comment 6mo ago · link · parent
comment 6mo ago · link · parent
Ocean currents and temperatures are major factors in storms, economic activity like trade, and ecosystems across the country. Monitoring them costs virtually nothing, and the benefits are huge.
comment 6mo ago · link · parent
GCs are definitely a strong point for Java, but most high-performance code can be rewritten to avoid pummeling memory management. This used to be common for Java in financial applications, not sure if it still is.
C++ has evolved its own compacting GCs like oilpan [0] for applications where high performance is inherently tied to allocation. Oilpan runs into pointer issues and isn't remotely comparable to G1GC or ZGC, but I think the speed of V8 speaks for itself. Rust allows you to drop in non free-list based allocators and GCs (e.g. Bumpalo), but they're relatively immature.
That may be because the information on that page seems to be up to date to 2011-2. Java is now on version 26, BTW.
The last time I dove into JVM internals was around the same time. I figured that someone who's worked with it more recently might have better examples than what's easily searchable.[0] https://chromium.googlesource.com/v8/v8/+/main/include/cppgc...
comment 6mo ago · link · parent
I don't know what it is that Rust demonstrates given that few large scale projects have chosen it, but I've seen nothing to indicate that it doesn't suffer from the same performance issues as C++ compared to Java.
The point of bringing up Rust is that it also gives the compiler much more information to optimize on than C++, but actual performance is comparable or slightly worse in most benchmarks because the quality of C++ codegen is so high. Some of those Rust advantages are exactly the same things that have been touted as major advantages for Java over C++, like escape analysis and lifetimes. Of course, in principle it's always possible to match and perhaps even exceed Java's performance in a low-level language, but in practice it becomes ever more difficult as the program grows (and the cost remains with maintenance forever).
Sure, which is why I asked for real examples of whatever you consider a "large scale" program. I wasn't able to find anything via search before I replied, and the wiki page on Java performance [0] is repeating what I understood.comment 6mo ago · link · parent
In general, the tradeoff is between optimisations that help large programs vs optimisations that help small programs.
Do you have concrete examples of large scale Java programs that are significantly more performant than comparable programs in native languages like C++? My understanding was that this dynamic hadn't fundamentally changed much since the 2010s, when Java was able to occasionally edge out a win in 1-2 benchmarks and would lose handily in others. My experience is that large scale Java programs remain a bit of a bear even after significant optimization effort (e.g. Bazel).There are of course plenty of optimizations the JVM does that aren't possible AOT, but that that doesn't imply an automatic win at large scales, as Rust demonstrates.
comment 6mo ago · link · parent
I have a standing challenge to my co-workers that valid compiler errors will be rewarded like a birthday party, with the baked goods, alcohol, or sweets of their choice. It's only been redeemed once, and I've found less than a dozen unreported compiler bugs myself.
comment 6mo ago · link · parent
Most companies buying anything from WolfSSL will already be using a script or toolchain flags to validate stack usage. And if they don't, even embedded toolchains generally support canaries these days.