Skip to main content

Compiler Explorer, Explored

It wasn’t long ago that we introduced you to a web site, the Godbolt compiler explorer, that allows the visitor to compile code using a slew of compilers and compare their output. We suspect some number of readers said, “Wow! I can use that!”, while perhaps everyone else said, “Huh?” Well if you were in the second group, you ought to watch [What’s a Creel’s] video below where he walks through using the website. He looks at four different algorithms using four different compilers and it is a good example of how you might use the tool to make decisions about how you write software.

If you missed our original post about the tool, you can still catch up. Even if you don’t care much about the compiler explorer, this is an opportunity to gaze over an experienced programmer’s shoulder as he looks at some C code and generated assembly code.

The results might surprise you. In the first example, CLANG did some great optimization but other compilers created a lot of code by comparison. One of the compilers, the Microsoft compiler, had an incorrect option specified, so it didn’t so well, but would probably do better with the right options. You could always try it yourself if you are interested.

We’d love to see something like this done for FPGAs. If you can run Docker, you might also be interestedin PenguinTrace.



from Hackaday https://ift.tt/2oIZU5P

Comments

Popular posts from this blog

Bill Gates steps down from Microsoft’s board to focus on philanthropy

In an announcement on Friday, Microsoft revealed that company co-founder Bill Gates has decided to step down from his role on its Board of Directors in order to focus on his philanthropic efforts at the Bill & Melinda Gates Foundation. This is Gate’s biggest change to his role at Microsoft since stepping down as company chairman in February 2014. According … Continue reading from SlashGear https://ift.tt/2We90Gu

Epic is probing an annoying Fortnite bug that causes stuck players

Epic Games has acknowledged reports of a frustrating Fortnite bug that is causing some players to become stuck in place, unable to move their character from the spot where it freezes. This same general issue is also causing issues in which players can move but are unable to access their backpack inventory, leaving them without most of their gear. Epic … Continue reading from SlashGear https://ift.tt/2Qqesmx

Capture a Star in a Jar with Sonoluminescence

If nothing else, [Justin Atkin] is persistent. How else do you explain a five-year quest to create sonoluminescence with simple tools ? So what exactly is sonoluminescence? The short answer is as the name suggests: a release of light caused by sound. In [Justin]’s case, he used an ultrasonic transducer to set up a standing wave at the resonant frequency of a flask of water. A drop of water is used to entrain a small air bubble, which is held in a stable position in the flask in much the same way as styrofoam beads are in an acoustic levitator . Turn off the lights and you’ll see that the bubble glows with a ghostly blue light. What causes the glow? Good question. According to [Justin], we just don’t know for sure what causes it, although the leading theory is that cavitation of the bubble causes the trapped gas to compress and heat violently, turning into a brief bit of plasma. But there are problems with that theory, which is one of the reasons he wanted to show just how easy the pr...