Rewriting Old Solaris C Code In Python Yielded A 17x Performance Improvement

Written by Michael Larabel in Oracle on 18 October 2019 at 12:52 PM EDT. 93 Comments
ORACLE
While we normally hear of rewriting code from Python and other scripting languages into C/C++ when its a matter of performance, in the case of Oracle Solaris it was taking old C code and modernizing it in Python 3 to yield a ~17x performance improvement.

Shared today on Oracle's official Solaris blog was an interesting anecdote about their listusers command being rewritten in Python 3 from C. Oracle's Darren Moffat noted the C code was largely untouched since around 1988 and given its design at a time when systems were less dense than today with hundreds or even thousands of users per system.

When rewriting the "listusers" functionality in Python he did make improvements to the design, so it's not just a straight C to Python conversion yielding the speed-up. This modernized Python implementation with some of their test datasets yielded "17 times faster" performance than the existing Solaris listusers command.


Besides being much faster, the Python version took just a tenth of the number of lines of code as the old C version -- thus lowering the maintenance burden moving forward. The anecdote can be found on blogs.oracle.com.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week