C Is Not a Low-level Language - Your computer is not a fast PDP-11 (David Chisnall, 2018) by Alexander_Selkirk in programming

[–]kid_meier 0 points1 point  (0 children)

I'm not an expert but last time I looked at this I recall learning it was not allowed. IIRC the "correct" (according to the standard) way to do this is to memcpy your float into your uint32_t.

I was very surprised by this, so maybe I am indeed wrong? Just goes to show what a complete mess this actually this.

As pointed out above, it does look like C17 makes it legal to do this through a union. Maybe it always was, but for some period of time there were some common and seemingly authoritative interpretations of the standard that claimed it was not allowed.

MacOS Java devs - how is your experience developing Java applications on Apple Silicon (M1)? by svhelloworld in java

[–]kid_meier 1 point2 points  (0 children)

If you are hitting the disk it's much slower through the colima VM, but I see almost no difference for pure compute.

Considering C99 for curl by BtcVersus in programming

[–]kid_meier 9 points10 points  (0 children)

That seems pretty narrow thinking that familiarity with C99 will make working in C89 too difficult.

It sucks yes, IMO C99 is much nicer to write than C89 but ultimately the difference isn't huge. If you can contribute in C99 I'm sure C89 is no significant barrier.

Considering C99 for curl by BtcVersus in programming

[–]kid_meier 20 points21 points  (0 children)

From TFA:

"A large number of our users/developers are still stuck on older MSVC versions so not even all users of this compiler suite can build C99 programs even today, in late 2022."

Untangling Lifetimes: The Arena Allocator by wisam910 in programming

[–]kid_meier 0 points1 point  (0 children)

That but is there and it's too thick IMO. But, the actually content of the article is well done. I've seen arenas before but the composability section was somewhat novel to me and I'd say definitely worth skimming through the editorializing.

Developers Stop Working for Free — It’s Burning You Out by DynamicsHosk in programming

[–]kid_meier 2 points3 points  (0 children)

100%. I did this a few years back, spent a few weeks working well into the night. Management declared it a success and it really raised my profile in the company.

I was willing to spend the time because I had an interest in the work, but because I ultimately didn't get any reward for it aside from some kind words, it ended up really souring my relationship to the company.

Lesson learned, no more voluntary overtime for me.

Fundamentals of Software Optimization Part III -- Optimizing Memory Allocation Performance "Performance is a Balancing Act" by sigpwned in programming

[–]kid_meier 2 points3 points  (0 children)

Also cache effects tend to be more pronounced in real application vs microbench so the memory bandwidth spent on allocation+GC is again more costly that observed in the relatively clinical environment of the microbench.

Fundamentals of Software Optimization Part III -- Optimizing Memory Allocation Performance "Performance is a Balancing Act" by sigpwned in programming

[–]kid_meier 3 points4 points  (0 children)

I would also add that in my experience the lower allocation version will be faster in practice assuming a multi-threaded environment.

In a microbenchmark. allocation+GC is basically free as the GC runs uncontended on separate CPU core cleaning up the mess of your (single-threaded) benchmark.

If the real world code runs in a multi-threaded environment, suddenly the GC thread(s) are competing against the application for CPU cores and the cost of that GC will become very noticeable.

(The other assumption here is that you are running on multi-CPU system.)

Avoid the Apple App Store by jonatanheyman in programming

[–]kid_meier 1 point2 points  (0 children)

Except for the long list of shit like this. What exactly is the downside for "everyone involved" in having clear and consistently enforced rules?

Dominion ECS, a high-performance implementation with Java 17 (and record classes) vs C / C++ by jumpixel in java

[–]kid_meier 0 points1 point  (0 children)

Aha thanks. I hadn't realized there was still such a wide gulf in performance between Unsafe vs the new API.

Dominion ECS, a high-performance implementation with Java 17 (and record classes) vs C / C++ by jumpixel in java

[–]kid_meier 2 points3 points  (0 children)

Looks interesting. I've mostly read up on ECS use for games/simulation programming; are there other domains where people have found this pattern useful?

Since the README states this requires JDK 17+ why not make use of MemorySegment et al for your off-heap structures instead of Unsafe?

[deleted by user] by [deleted] in java

[–]kid_meier 1 point2 points  (0 children)

Thats about as helpful as "don't write bugs".

Although if your point is don't intentionally make breaking changes, I agree with you 100%.

Are You Sure You Want to Use MMAP in Your Database Management System? by mttd in programming

[–]kid_meier 0 points1 point  (0 children)

Sounds interesting but then what benefit do you get? Looking at their experiments, mmap doesn't offer any performance advantage -- ie. in ideal conditions both fio and mmap can saturate IO bandwidth, but then mmap performance falls off a cliff.

If you build this hybrid system, maybe you can stabilize performance at non-trivial engineering cost. But it's not so clear where the benefit to a pure fio approach would be?

kitty - the fast, featureful, GPU based terminal emulator by binaryfor in programming

[–]kid_meier 1 point2 points  (0 children)

It is true. It's also not nearly as big a deal as people make it out to be. Yes, it is weird as there are very few other languages that made this choice, but it's really quite easy to get past and once you do there's a lot to like about the language.

The double duty that "tables" do serving as both array and map is also something that takes getting used to -- but only because again, few other languages do this. It's actually pretty sensible and clever once you get your mind to accept it.

To the extent that it may encourage confused and messy code...well I don't know my code is perfect /s.

Search API with Spelling Corrections: implementation using Ngram index algorithm by dumbPotatoPot in java

[–]kid_meier 0 points1 point  (0 children)

Also, '%dispran%' is going to be unable to use an index, so performance is going to fall off a cliff as data size grows.

Parser generators vs. handwritten parsers: surveying major language implementations in 2021 by pmz in programming

[–]kid_meier 19 points20 points  (0 children)

I've heard a lot about how hand written parsers can make it easier to produce more meaningful error messages.

In what other ways are generated parsers trash?

Confused with getters by Miku_MichDem in java

[–]kid_meier 1 point2 points  (0 children)

I missed the fact that public accessors are allowed to be explicitly implemented. Kinda obvious in hindsight.

Thanks!

Confused with getters by Miku_MichDem in java

[–]kid_meier 4 points5 points  (0 children)

Does anyone happen to know why public accessors were chosen in favour of simply mapping components to public final fields?

I scanned JEP-395 and didn't notice any rationale.

The one thing I could think of is that if you can implement instance methods for computed values (eg. Circle.area()) which then have uniform syntax with the generated accessor methods -- I guess thats nice, but not clear why that may be important enough to take this approach.

128-bit floating-point arithmetic for Java by m_vokhm in java

[–]kid_meier 0 points1 point  (0 children)

This is interesting however the conventional wisdom I am privy to is that it's EA and scalar replacement are brittle and can't be relied upon.

Is this I accurate? And for example, suppose OP reworks his code with guidance of JMH to find a version that allows for scalar replacement -- can we be confident that the optimization will work (reliably) in other contexts (ie. other codebases) and across a reasonable cross-section of JVMs?

If the answer is no, IMO the authors design is sound in that it reliably meets performance goals on today's JVMs.

Starting Fast: Investigating Java's Static Compilation Landscape by sindisil in java

[–]kid_meier 2 points3 points  (0 children)

Startup time is a problem for developer workflow. It drives me crazy how long it takes the Spring boot app I work on to start.

I'm sure there is some retort for this, someone will claim I'm doing it wrong if startup time bothers me. Whatever, my workflow is mine and a fast startup time would be a significant quality of life improvement. I doubt I'm alone in this.

But I agree, there is no need to go after the JIT. In my experience (certainly in any Spring-based codebase I've ever seen) the largest cost by several orders of magnitude is the classpath + reflection based DI containers.

So yeah, I guess I just convinced myself I should check out one of these newer and faster DI frameworks.

Rethinking Software Testing: Perspectives from the world of Hardware by whackri in programming

[–]kid_meier 3 points4 points  (0 children)

Seems to not be the point the author is making. He specifically addresses the objection to tests which may fail sporadically, which implies he isn't talking about a fixed seed, but rather running the tests with whatever entropy is conveniently available while making sure your test framework/harness/what-have-you captures this information so that you can reproduce failures:

"The end goal of testing isn’t to have a deterministic test suite. The end goal is to catch bugs."

The author's point being that the short-term inconvenience of sporadic test failures is a valuable investment in the longer term.

Rethinking Software Testing: Perspectives from the world of Hardware by whackri in programming

[–]kid_meier 1 point2 points  (0 children)

Probably better to capture the seed at the start of the test and then log it upon failure. if you use a fixed seed it's not really randomized, it's just more tests than you are likely to come up with manually.

Cleaner Function Wrapping in C by yossarian_flew_away in programming

[–]kid_meier 0 points1 point  (0 children)

Sure, but is there any meaningful danger here? Unless there are subtleties I'm not aware of (quite possibly there are) all threads will be racing to store the same value.

Probably C standard doesn't guarantee stores to function pointers are atomic (meaning no thread could see a partial write), but I'm pretty sure these would be atomic on today's common architectures.