The Performance Impact Of C++’s `final` Keyword For Optimization

In the world of software development the term ‘optimization’ is generally reason for experienced developers to start feeling decidedly nervous, especially when a feature is marked as an ‘easy and free optimization’. The final keyword introduced in C++11 is one of such features. It promises a way to speed up object-oriented code by omitting the vtable call indirection by marking a class or member function as – unsurprisingly – final, meaning that it cannot be inherited from or overridden. Inspired by this promise, [Benjamin Summerton] figured that he’d run a range of benchmarks to see what performance uplift he’d get on his ray tracing project.

To be as thorough as possible, the tests were run on three different systems, including 64-bit Intel and AMD systems, as well as on Apple Silicon (M1). For the compilers various versions of GCC (12.x, 13.x), as well as Clang  (15, 17) and MSVC (17) were employed, with rather interesting results for final versus no final tests. Clang was probably the biggest surprise, as with the keyword added, performance with Clang-generated code absolutely tanked. MSVC was a mixed bag, as were the GCC versions other than GCC 13.2 on AMD Ryzen, which saw a bump of a few percent faster.

Ultimately, it seems that there’s no free lunch as usual, and adding final to your code falls distinctly under ‘only use it if you know what you’re doing’. As things stand, the resulting behavior seems wildly inconsistent.

New JEDEC DDR5 Memory Specification: Up To 8800 MT/s, Anti-Rowhammer Features

Rapid row activations (yellow rows) may change the values of bits stored in victim row (purple row).
Row hammer” by DsimicOwn work. Licensed under CC BY-SA 4.0 via Wikimedia Commons.

As DDR SDRAM increases in density and speed, so too do new challenges and opportunities appear. In the recent DDR5 update by JEDEC – as reported by Anandtech – we see not only a big speed increase from the previous maximum of 6800 Mbps to 8800 Mbps, but also the deprecation of Partial Array Self Refresh (PASR) due to security concerns, and the introduction of Per-Row Activation Counting (PRAC), which should help with row hammer-related (security) implications.

Increasing transfer speeds is primarily a matter of timings within the limits set by the overall design of DDR5, while the changes to features like PASR and PRAC are more fundamental. PASR is mostly a power-saving feature, but can apparently be abused for nefarious means, which is why it’s now gone. As for PRAC, this directly addresses the issue of row hammer attacks. Back in the 2014-era of DDR3, row hammer was mostly regarded as a way to corrupt data in RAM, but later it was found to be also a way to compromise security and effect exploits like privilege escalation.

The way PRAC seeks to prevent this is by keeping track of how often a row is being accessed, with a certain limit after which neighboring memory cells get a chance to recover from the bleed-over that is at the core of row hammer attacks. All of which means that theoretically new DDR5 RAM and memory controllers should be even faster and more secure, which is good news all around.

Amazon Ends California Drone Deliveries While Expanding To Arizona

The outgoing MK27 drone used by Amazon today for deliveries. (Credit: Amazon)
The outgoing MK27 drone used by Amazon today for deliveries. (Credit: Amazon)

When Amazon started its Prime Air drone delivery service in 2022, it had picked College Station (Texas) and Lockeford (California) as its the first areas where the service would be offered. Two years later, Amazon has now announced that it will be expanding to the West Valley of the Phoenix Metro area in Arizona from a new Tolleson center, while casually mentioning buried in the press release that the Lockeford area will no longer be serviced. No reason for this closure was provided, but as a quite experimental service drastic shifts can be expected as Amazon figures out what does and does not work.

Amazon Prime Air features custom drones that can transport packages up to 5 lbs (~2.27 kg) to its destination within an hour, if the item is listed as Prime Air capable for your area. Along with the change in service areas, Amazon is also testing its new MK30 drone (pictured, top), which should be much quieter due to a new propeller design and have twice the range of the old MK27 as well.

Even if flying drone delivery isn’t quite a blow-away success yet, Amazon doesn’t seem to be letting up on investing in it, and it could be argued that for certain items like medication or perishables, it does make a certain sense over traditional delivery and pick-up methods.

Programming Ada: First Steps On The Desktop

Who doesn’t want to use a programming language that is designed to be reliable, straightforward to learn and also happens to be certified for everything from avionics to rockets and ICBMs? Despite Ada’s strong roots and impressive legacy, it has the reputation among the average hobbyist of being ‘complicated’ and ‘obscure’, yet this couldn’t be further from the truth, as previously explained. In fact, anyone who has some or even no programming experience can learn Ada, as the very premise of Ada is that it removes complexity and ambiguity from programming.

In this first part of a series, we will be looking at getting up and running with a basic desktop development environment on Windows and Linux, and run through some Ada code that gets one familiarized with the syntax and basic principles of the Ada syntax. As for the used Ada version, we will be targeting Ada 2012, as the newer Ada 2022 standard was only just approved in 2023 and doesn’t change anything significant for our purposes.

Continue reading “Programming Ada: First Steps On The Desktop”

Dual-Wavelength SLA 3D Printing: Fast Continuous Printing With ROMP And FRP Resins

As widespread as 3D printing with stereolithography (SLA) is in the consumer market, these additive manufacturing (AM) machines are limited to a single UV light source and the polymerization of free-radical polymerization (FRP) resins. The effect is that the object is printed in layers, with each layer adhering not only to the previous layer, but also the transparent (FEP or similar) film at the bottom of the resin vat. The resulting peeling of the layer from the film both necessitates a pause in the printing process, but also puts significant stress on the part being printed. Over the years a few solutions have been developed, with Sandia National Laboratories’ SWOMP technology (PR version) being among the latest.

Unlike the more common FRP-based SLA resins, SWOMP (Selective Dual-Wavelength Olefin Metathesis 3D-Printing) uses ring-opening metathesis polymerization (ROMP), which itself has been commercialized since the 1970s, but was not previously used with photopolymerization in this fashion. For the monomer dicyclopentadiene (DCPD) was chosen, with HeatMet (HM) as the photo-active olefin metathesis catalyst. This enables the UV-sensitivity, with an added photobase generator (PBG) which can be used to selectively deactivate polymerization.

Continue reading “Dual-Wavelength SLA 3D Printing: Fast Continuous Printing With ROMP And FRP Resins”

NASA’s Voyager 1 Resumes Sending Engineering Updates To Earth

After many tense months, it seems that thanks to a gaggle of brilliant engineering talent and a lucky break the Voyager 1 spacecraft is once more back in action. Confirmation came on April 20th, when Voyager 1 transmitted its first data since it fell silent on November 14 2023. As previously suspected, the issue was a defective memory chip in the flight data system (FDS), which among other things is responsible for preparing the data it receives from other systems before it is transmitted back to Earth. As at this point in time Voyager 1 is at an approximate 24 billion kilometers distance, this made for a few tense days for those involved.

The firmware patch that got sent over on April 18th contained an initial test to validate the theory, moving the code responsible for the engineering data packaging to a new spot in the FDS memory. If the theory was correct, this should mean that this time the correct data should be sent back from Voyager. Twice a 22.5 hour trip and change through Deep Space and back later on April 20th the team was ecstatic to see what they had hoped for.

With this initial test successful, the team can now move on to moving the remaining code away from the faulty memory after which regular science operations should resume, and giving the plucky spacecraft a new lease on life at the still tender age of 46.

How Wireless Charging Works And Why It’s Terrible

Wireless charging is pretty convenient, as long as the transmitter and receiver speak the same protocol. Just put the device you want to charge on the wireless charger without worrying about plugging in a cable. Yet as it turns out, the disadvantages of wireless charging may be more severe than you think, at least according to tests by iFixIt’s [Shahram Mokhtari] and colleagues. In the article the basics of wireless charging are covered, as well as why wireless charging wastes a lot more power even when not charging, and why it may damage your device’s battery faster than wired charging.

The inefficiency comes mostly from the extra steps needed to create the alternating current (AC) with wireless coupling between the coils, and the conversion back to DC. Yet it is compounded by the issue of misaligned coils, which further introduce inefficiencies. Though various protocols seek to fix this (Qi2 and Apple’s MagSafe) using alignment magnets, these manage to lose 59% of the power drawn from the mains due to these inefficiencies. Wireless chargers also are forced to stay active, polling for a new device to charge, which keeps a MagSafe charger sucking up 0.2 W in standby.

Continue reading “How Wireless Charging Works And Why It’s Terrible”