Are you missing out on opportunities to increase your applications' performance? As an application developer building on Red Hat Enterprise Linux, you invest a lot of time and effort into making your applications compelling and useful for your users. You probably also want to see good performance. But beyond good design, careful algorithm selection and compiler optimizations, what can a developer use to boost their application performance?
1. The latest GCC release and associated tools
The very first thing a Red Hat Enterprise Linux developer should be aware of is the availability of Red Hat Developer Toolset. I described the content and architecture of this new offering from Red Hat in my last blog post. Developer Toolset 1.x gives you the gcc-4.7 toolchain, which, at the time of writing, is the current upstream major release.
The compilers in Red Hat Enterprise Linux itself are focused on high stability, and Red Hat stands behind that for a decade with our service level support agreements. In contrast, Developer Toolset's generally has a faster update cycle which allows us to pass along newer releases to Red Hat Enterprise Linux users. This means the compiler in Developer Toolset benefits from more up-to-date tools, reflecting three years of concerted community development effort upstream. It also means more potential optimizations and efficiency improvements for you. So, while not guaranteed for every application, you're likely to find that your application receives a performance boost just by recompiling.
Developer Toolset 1.1 provides updated versions of the compiler (gcc-4.7.2), assembler, linker and related tools (binutils-220.127.116.11.3) and debugger (gdb-18.104.22.16820926) compared to those shipped in Red Hat Developer Toolset 1.0 and builds on an updated version of the Software Collections framework (scl-utils-20120613).
And, fortunately, updating from a Developer Toolset 1.0 installation to this new 1.1 release is as simple as running 'yum update' with root permissions.
2. Three powerful performance analysis tools
Version 1.1 of the Developer Toolset includes three new tools not found in Developer Toolset 1.0. These are SystemTap 1.8, Valgrind 3.8.1 and Oprofile 0.9.7, and all three help you analyse your application's performance so you can find out where you're losing efficiency and adjust your application accordingly.
SystemTap provides a simple command line interface and scripting language for writing instrumentation for a live running Linux kernel plus user-space applications. Developers can use the supplied tools to write and execute instrumentation scripts to collect data on the operation of the system.
Another tool, Valgrind, is both an instrumentation framework for building dynamic analysis tools and a number of such tools. These automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build your own domain-specific analysis tools if you find the supplied tools don't give you what you need.
Finally, OProfile is a system-wide profiler for Linux systems, capable of profiling running code with low overhead. OProfile uses the hardware performance counters of the latest CPUs to enable profiling of a wide variety of interesting statistics, including basic "time-spent" profiling. A wide variety of code can be profiled: hardware and software interrupt handlers, kernel modules, the kernel, shared libraries, and applications.
3. Two tools for working with application binaries
Sometimes your ability to optimize applications is slowed down by the development tools you are using or the size of your binaries. As an example, debug information embedded in your development builds of binaries and shared libraries can become a significant size overhead, slowing down file transfers and using large amounts of memory. Developer Toolset 1.1 includes a new tool developed by Red Hat engineers - dwz-0.7 - to reduce the size of your debug information. Naturally, as we're Red Hat, the tool has also been released under an open source license.
For those interested in the detail of this tool's operation, it essentially attempts to optimize DWARF debugging information contained in ELF shared libraries and executables for size. It does this by replacing DWARF information representations with equivalent smaller representation where possible and by reducing the amount of duplication, all using techniques from the DWARF standard. DW_TAG_partial_unit compilation units are created for duplicated information and a DW_TAG_imported_unit is used to import those into each compilation unit that requires them.
The second tool for working with binaries is elfutils-0.154, an earlier, stability-focused build of which can also be found in Red Hat Enterprise Linux releases. The Developer Toolset elfutils package contains newer upstream versions of utilities and libraries for working with compiled binary files. Its libraries are actually used by SystemTap, but it's also a great tool for inspecting the content of your binaries to look for redundancy (for example, unstripped symbols) or corruption.
4. Fortran support
For those developers who have large amounts of legacy Fortran code or whose work makes programming Fortran the right tool for the job, Developer Toolset 1.1 adds Fortran to the C and C++ support shipped in Developer Toolset 1.0.
Similarly to the compiler upgrade described above, the Fortran compiler is built from the gcc-4.7.2 upstream release branch and consequently is several years newer than the stability-focused gcc-4.4 toolchain provided in Red Hat Enterprise Linux 6. And if your Red Hat Enterprise Linux 5 Fortran projects are based around the default gcc-4.1 compiler, Developer Toolset's gfortran will bring you the fruits of a full six years of upstream development work.
We hope these new features allow you, as a Red Hat developer, to more productively develop your applications and increase their performance for your end users. Don't forget that updating your Developer Toolset 1.0 installation to this new 1.1 release is as simple as running 'yum update' with root permissions, so why not update and experiment today?
In future posts to this blog, we'll talk more about:
- how to get the most from the various performance analysis tools now shipping in Developer Toolset 1.1
- how Software Collections, the foundation of Developer Toolset, work
- features and tools we expect to include in Red Hat Developer Toolset v2.0
- practical hands-on tutorials on installing and using Developer Toolset
As usual, if you have any thoughts or feedback on Developer Toolset 1.1, or if you have other tools and features in mind that you'd like to see us add in future releases, we'd love to hear from you - thanks!Last updated: January 9, 2023