Jahrain Jackson was born in St. Croix and grew up in several different places. He graduated from Pahoa High School on the Island of Hawaii in 2006 and is currently a student at the University of Hawai’i at Hilo majoring in Computer Science. As a hobby and a potential career, Jahrain enjoys software programming, and 3d modeling and animation.
Home Island: Big Island
High School: Pahoa High School
Institution when accepted: University of Hawaii at Hilo
Akamai Project: C++ vs. Python
Project Site: Subaru Telescope
Mentor: Matt Dinkins
The Subaru Observatory’s software development team is presently migrating computer code for the instrument control systems from C/C++ to Python. However, there is little information available on what performance issues may occur between translations of the two languages. This information is critical when making the decision of where and when migration is feasible. My project studies the performance differences of each through a series of benchmarking algorithms written in both languages. Each benchmark was written to focus on the performance of common tasks in most programs including searches, sorting, string manipulation, floating point arithmetic, and memory management. The benchmarks provide a detailed performance analysis including execution time and consistency with multiple iterations. Our tests have shown that Python is strongest when fully utilizing its built in high level data structures and methods. Surprisingly, the string sorting and searching benchmarks in Python ran at about 2 to 3 times faster than the C++ equivalent. However, Python also has shown a hefty performance drop, running 300 times slower than C in the ray tracing test that involves deep nested for-loops, heavy memory consumption, and floating point arithmetic. Also due to the global interpreter lock in Python, multi-threaded tasks cannot utilize multiple CPUs. Since C/C++ code can be integrated into Python, any performance critical sections of code that are heavy in mathematical operations, contain deep nested loops, or are highly memory intensive should be left in C/C++. For most other applications, the performance impact from switching to Python is negligible, if not better.