Programming Leftovers
-
Automotive Grade Linux Releases UCB 14 Platform with Additional Support for App Development with Flutter
Automotive Grade Linux (AGL), a collaborative cross-industry effort developing an open source platform for all connected car technologies, has announced the latest code release of the AGL platform, UCB 14, also known under the codename "Nifty Needlefish."
-
.tar sorting vs .xz compression ratio - Michał Górny
It is a pretty common knowledge that ordering of members within archive can affect the compression ratio. I’ve done some quick testing and the results somewhat surprised me. Firstly, it turned out that the simplest lexical sorting by name (path) gave the best result. Secondly, because it turned out that the difference between that and sorting by size was as large as 8%.
Note that this is a pretty specific source archive, so results may vary. Test details and commands in the remainder of the post.
-
Refactoring with `=delete` – Arthur O'Dwyer – Stuff mostly about C++
-
Performance Optimizations Can Have Unexpectedly Large Effects When Combined With Caches
In 2017, I was working a major performance issue. We were onboarding a large customer, and a batch process was taking 3 hours1, long enough to mean that trucks would be waiting at the dock, shipments would be fulfilled a day late, etc.
We were able to run the whole process under a sampling profiler, and found that the foo method was taking roughly 50% of the time. Fortunately, it wasn't hard to see room for improvement. The details were tricky, but after some work, I thought I had a solid improvement. I could avoid at least half of the work in the foo method, so perhaps I could shave 45 minutes off the whole process.
We uploaded code to the test environment, expecting to wait a few hours, but the entire process finished in 45 minutes. Instead of a 45 minute savings, we'd shaved off 2 hours and 15 minutes. My first instinct was that we had a bug--nothing is faster than throwing an exception, or skipping all the real work.
In fact, the code was fine. What I didn't realize is that the code pulled data from caches that expired as time went on, and a significant portion of the original 3 hours was spent fetching data that had expired from the cache. After optimizing one slow portion of the code, other portions were reaching from the cache and the overall speedup was larger than seemed possible.
It's common wisdom that systems with caches can fail badly when the caches are cold. When every request misses the cache, the system is overloaded, and never recovers. What I observed was the mirror image.
-
The hidden cost of complexity. Complexity is an abstract and elusive… | by Dolev Pomeranz | Oct, 2022 | Medium
To better understand the real and deadly cost of complexity. By noticing our biased perception of both simplicity and complexity. And also by modeling complexity to uncover some of its characteristics. Mainly it’s exponential nature.
-
Why do we call it "boilerplate code?" • Buttondown
Now that Twitter is on a downward spiral I’m rewriting my favorite tweetstorms in a more permanent medium, so here’s the first: why do we have the term “boilerplate code”? It comes from the peculiar interplay of two industrial revolution technologies: steam engines and hot metal typesetting.
So let’s start with the steam engine. Steam engines run on steam, produced by a water boiler. The hotter you can get the steam, the more efficiently you can extract energy from it. Now according to the ideal gas law, if you increase the temperature of a gas while holding the volume constant, you’ll also increase the pressure. If the boiler can’t handle the pressure, it explodes. This is a bad thing.
-
Is Everything Is A File?
Strictly speaking, Unix itself doesn't perfectly conform to any of these, but it does follow them enough in enough places that they're recognizable and influential. And then there's Plan 9 which took some of these ideas further.
So there's a lot to explore here. This is the first of a series of blog posts exploring different aspects of Everything Is A File, with an overall focus on system interface design.
To get things started, here's a quick exploration of one small but illustrative quirk of Unix.
-
Data Types in R
There are five basic data types in R: [...]
-
A fast function to check your floating-point rounding mode
In my tests, on both an Apple ARM platform and on a recent Intel processor with GCC, this fast function is several times faster than a call to fegetround(). It is cheap enough that you can probably call it repeatedly without much care.
-
10 Cool and Awesome Bash Loop Examples
In the programming language, there are mainly three types of loops (for, while, and until). All three types of loops are important in different ways. There is not much difference between the while and until loops, but for loop works quite differently from these two. That’s why you can use these loops to create interactive scripts as a bash user.
So learning bash examples can help you improve your skills in creating scripts. So in this tutorial, we will include 10 cool and awesome bash loop examples you can try to enhance your scripting skills.
-
Display the most active ethernet interface