Researchers from the University of Massachusetts Amherst introduced Scalene, an advanced Python profiling tool. Unlike traditional profilers, Scalene uses AI to both identify and recommend fixes for code inefficiencies. This development is important as the future moves toward better programming to improve speed.
The development of the Scalene family, an open source tool that significantly accelerates the Python programming language, avoids hardware problems that limit computer processing speed.
A team of computer scientists at the University of Massachusetts Amherst, led by Emery Berger, recently announced an award-winning Python parser called Scalene. Programs written in Python are notoriously slow—up to 60,000 times slower than code written in other programming languages—and Scalene works to efficiently identify exactly where Python is slow, allowing programmers troubleshoot and streamline their code for better performance.
There are many different programming languages—C++, Fortran, and Java are some of the better known—but in recent years, one language has become almost ubiquitous: Python.
“Python is a ‘battery included’ language,” said Berger, a professor of computer science in the Manning College of Computer and Information Sciences at UMass Amherst, “and it has become very popular during great data science and machine learning because it is very user-friendly.” The language comes with easy-to-use tool libraries and has an intuitive, easy-to-read syntax, allowing users to start writing Python code quickly.
“Computers aren’t getting any faster. Future speed improvements will come less from better hardware and more from faster, more efficient programming.”
— Emery Berger, professor of computer science in the Manning College of Computer and Information Sciences at UMass Amherst
Python’s efficiency woes
“But Python is extremely inefficient,” says Berger. “It easily runs 100 to 1,000 times slower than other languages, and some tasks can take 60,000 times longer in Python.”
UMass Amherst computer science professor Emery Berger. Credit: UMass Amherst
Programmers have known this for a long time, and to combat Python’s inefficiencies, they can use tools called “compilers.” The analyzer runs the programs and then determines why and which parts are running slow.
Unfortunately, current profilers are of little help to Python programmers. At best, they indicate that an area of code is slow and let the programmer figure out what, if anything, can be done.
Berger’s team, which includes UMass computer science graduate students Sam Stern and Juan Altmayer Pizzorno, built Scalene to be the first profiling tool that doesn’t just pinpoint inefficiencies in Python code but also uses AI to suggest ways to improve the code.
“First, Scalene shows where your program is wasting time,” Berger says. It focuses on three main areas—CPU, GPU, and memory usage—that account for most of Python’s sluggish performance.
Once it identifies where Python is struggling to keep up, Scalene will use AI — leveraging the same technology that underpins ChatGPT — to suggest ways to optimize individual lines or even groups of code.
“This is an actionable dashboard,” Berger said. “Not only does the speedometer tell you how fast or slow your car is going, it also tells you whether you could go faster, why your speed is being affected, and what you can do to reach maximum speed.”
The future of programming and the impact of Scalene
“Computers aren’t getting any faster,” Berger said. “Future improvements in speed will come less from better hardware and more from faster, more efficient programming.”
Scalene is widely used and has been downloaded more than 750,000 times since its public launch on GitHub. The research that led to the development of Scalene was supported by the National Science Foundation. A paper describing this work appeared at this year’s USENIX Conference on Operating Systems Design and Implementation, where it won the Best of Show award.
#Turbocharged #Python #speeds #calculations #thousands #times
World Innovations: Top Trends Shaping the Future Worldwide
Global Migration Trends: Understanding the Modern Movement of People
World Sports: Discover the Most Exciting Global Sporting Events