What is the right time to optimize code? This is a very good question, which usually comes down to two answers. The first answer is to have a good design for the code to begin with, because ‘optimization’ does not mean ‘fixing bad design decisions’. The second answer is that it should happen after the application has been sufficiently debugged and its developers are at risk of getting bored.
There should also be a goal for the optimization, based on what makes sense for the application. Does it need to process data faster? Should it send less data over the network or to disk? Shouldn’t one really have a look at that memory usage? And just what is going on inside those CPU caches that makes performance sometimes drop off a cliff on a single core?
All of this and more can be analyzed using tools from the Valgrind suite, including Cachegrind, Callgrind, DHAT and Massif.
Keeping Those Cores Cool
Modern day processors are designed with low power usage in mind, regardless of whether they are aimed at servers, desktop systems or embedded applications. This essentially means that they are in a low power state when not doing any work (idle loop), with some CPUs and microcontrollers turning off power to parts of the chip which are not being used. Consequently, the more the processor has to do, the more power it will use and the hotter it will get.
Because of the architecture used for the Apollo missions, extended stays on the surface of the Moon weren’t possible. The spartan Lunar Module simply wasn’t large enough to support excursions of more than a few days in length, and even that would be pushing the edge of the envelope. But then the Apollo program was never intended to be anything more than a proof of concept, to demonstrate that humans could make a controlled landing on the Moon and return to Earth safely. It was always assumed that more detailed explorations would happen on later missions with more advanced equipment and spacecraft.
Now NASA hopes that’s finally going to happen in the 2020s as part of its Artemis program. These missions won’t just be sightseeing trips, the agency says they’re returning with the goal of building a sustainable infrastructure on and around our nearest celestial neighbor. With a space station in lunar orbit and a permanent outpost on the surface, personnel could be regularly shuttled between the Earth and Moon similar to how crew rotations are currently handled on the International Space Station.
Artemis lander concept
Naturally, there are quite a few technical challenges that need to be addressed before that can happen. A major one is finding ways to safely and accurately deliver multiple payloads to the lunar surface. Building a Moon outpost will be a lot harder if all of its principle modules land several kilometers away from each other, so NASA is partnering with commercial companies to develop crew and cargo vehicles that are capable of high precision landings.
But bringing them down accurately is only half the problem. The Apollo Lunar Module is by far the largest and heaviest object that humanity has ever landed on another celestial body, but it’s absolutely dwarfed by some of the vehicles and components that NASA is considering for the Artemis program. There’s a very real concern that the powerful rocket engines required to gracefully lower these massive craft to the lunar surface might kick up a dangerous cloud of high-velocity dust and debris. In extreme cases, the lander could even find itself touching down at the bottom of a freshly dug crater.
Of course, the logical solution is to build hardened landing pads around the Artemis Base Camp that can support these heavyweight vehicles. But that leads to something of a “Chicken and Egg” problem: how do you build a suitable landing pad if you can’t transport large amounts of material to the surface in the first place? There are a few different approaches being considered to solve this problem, but certainly one of the most interesting among them is the idea proposed by Masten Space Systems. Their experimental technique would allow a rocket engine to literally build its own landing pad by spraying molten aluminum as it approaches the lunar surface.
While the car world is obsessed with everything boosted these days, many still yearn for the smooth power delivery and sonorous tone of a naturally aspirated engine. Of course, everyone still wants to go fast, so here’s how you go about getting more power out of your car without bolting on a big turbo or whining supercharger.
Intakes: This Can Get Pretty Invovled
A modified intake installed on a Honda S2000. Also referred to as “cold-air intakes”, they aim to suck in air at lower temperature which helps produce more power – hence the shield between the air filter and exhaust.
The intake is one of the first modifications made by many budding car enthusiasts. Throwing on a chromed intake pipe with a big pod filter was the mod to have back in the Fast and Furious era. Power gains can be had, though typically these are minor – on the order of 5-10 horsepower at most. It all depends on the car in question. A BMW M5 V10 was designed for high performance, with a highly advanced intake with individual throttle bodies from the factory. It’s unlikely any eBay parts are going to unlock horsepower that BMW’s engineers didn’t already find. Conversely, early Mazda Miatas are known to have a restrictive intake, largely due to the flap-type air flow meter. Replacing this with a freer-flowing setup has merit.
The 2020 Hackaday Prize begins right now. Our global engineering challenge seeks solutions to real-world problems. If you like to come up with creative solutions to tough problems, four non-profits can use your help. We need hackers, designers, and engineers throughout the world to work on designs for conservation, disaster relief, renewable resources, and assistive devices.
This is the seventh year of the Hackaday Prize, and like past years we want to see your ideas take shape, so share your design process in detail as a project page on Hackaday.io. Over $200,000 in prizes are at stake, with a $50,000 prize for the all around best solution which will then be designed for manufacture at Supplyframe’s DesignLab, produced in a limited run, and deployed in the field.
New this year is our partnership with non-profits that have each outlined challenges they are facing. Eight projects, one top finisher, and one runner up from each of the four categories of challenges, will receive $10,000 and $3,000 respectively. As with previous years, the bootstrap round offers some seed money for getting your prototype off the ground: up to $500 for each of the top twenty during early entry judging. There’s even a $5,000 wildcard prize for entries that don’t specifically address challenges from the four categories. Here’s a taste of the categories you can work on:
Develop solutions to combat invasive species in marine and island environments, and help craft tools for protecting our natural ocean landscapes
Low cost tools for use in the field like a heat sealers/welders, and medical devices like IV fluid warmers
Adaptive technologies for workstations like trackballs, joysticks, and large button controllers
Modular add-ons for earthen housing for connectivity, light, heating, and water storage
Albert Dremel developed the now famous rotary tool and started the company in 1932 to make blade sharpeners. It would be 1935 before the company produced the Moto-Tool which is mostly recognizable as an ancestor of the modern Dremel.
Dremel achieved such dominance that today the name is synonymous with rotary tools in the same way Xerox means photocopy and Crock-Pot is any slow cooker. Sure, there are knock offs you can get from the usual cheap tool outlets, but generally, people reach for a Dremel even when it isn’t really one. Today that tool might really be a Black and Decker or a Dewalt or even a cheap brand like Wen or Chicago Electric. But in the first half of the 20th century, you might have reached for a Handee.
A Whole Shop Full of Tools
The Handee was a product of the Chicago Wheel and Manufacturing Company who, in 1937, billed it as “a whole shop full of tools in one,” as you can see in this ad. While $10.75 might sound like a price for a Harbor Freight cheapie tool, adjusted for inflation that’s around $200 in 2020 money. At least for that price you got three free accessories out of the over 200 available.
I didn’t remember the Handee and I wanted to see if I could figure out what happened to it and the company who made it. After all, with the Internet at your disposal, how hard could it be? Turns out, I did learn a lot, but in the end, tracing down a company like this from the old days isn’t always as easy as you might think.
Air-to-air combat or “dogfighting” was once a very personal affair. Pilots of the First and Second World War had to get so close to land a hit with their guns that it wasn’t uncommon for altercations to end in a mid-air collision. But by the 1960s, guided missile technology had advanced to the point that a fighter could lock onto an enemy aircraft and fire before the target even came into visual range. The skill and experience of a pilot was no longer enough to guarantee the outcome of an engagement, and a new arms race was born.
An F-15 launching flare countermeasures.
Naturally, the move to guided weapons triggered the development of defensive countermeasures that could confuse them. If the missile is guided by radar, the target aircraft can eject a cloud of metallic strips known as chaff to overwhelm its targeting system. Heat-seeking missiles can be thrown off with a flare that burns hotter than the aircraft’s engine exhaust. Both techniques are simple, reliable, and have remained effective after more than a half-century of guided missile development.
But they aren’t perfect. The biggest problem is that both chaff and flares are a finite resource: once the aircraft has expended its stock, it’s left defenseless. They also only work for a limited amount of time, which makes timing their deployment absolutely critical. Automated dispensers can help ensure that the countermeasures are used as efficiently as possible, but sustained enemy fire could still deplete the aircraft’s defensive systems if given enough time.
In an effort to develop the ultimate in defensive countermeasures, the United States Navy has been working on a system that can project decoy aircraft in mid-air. Referred to as “Ghosts” in the recently published patent, several of these phantom aircraft could be generated for as long as the system has electrical power. History tells us that the proliferation of this technology will inevitably lead to the development of an even more sensitive guided missile, but in the meantime, it could give American aircraft a considerable advantage in any potential air-to-air engagements.
A while back, I sat in the newish electric car that was the pride and joy of a friend of mine, and had what was at the time an odd experience. Instead of getting in, turning the key, and driving off, the car instead had to boot up.
The feeling was of a piece of software rather than a piece of hardware, and there was a tangible wait before the start button could be pressed. It was a miracle of technology that could travel smoothly and quietly for all but the longest journeys I could possibly throw at it on relative pennies-worth of electricity, but I hated it. As a technologist and car enthusiast, I should be all over these types of motor vehicles. I live for new technology and I lust after its latest incarnations in many fields including automobiles.
I want my next car to have an electric motor, I want it to push the boundaries of what is capable with a battery and I want it to be an automotive tour de force. The switch to electric cars represents an opportunity like no other to deliver a new type of car that doesn’t carry the baggage of what has gone before, but in that car I saw a future in which they were going badly astray.
I don’t want my next vehicle to be a car like my friend’s one, and to understand why that is the case it’s worth going back a few decades to the cars my parents drove back when when jumpers were goalposts, and the home computer was just a gleam in the eye of a few long-haired outsiders in California.