A team of scientists from Massachusetts University in Amperst, under the leadership of Emer Berger, recently introduced the prize Python provider called scalene . Programs written on Python are known for their slow work – they can be more slowly 60,000 times compared to the code in other programming languages. Scalene is aimed at the effective determination of slow areas in Python, which allows developers to optimize their code to increase performance.
“Python has become incredibly popular in the era of the science of data and machine learning due to its friendship for the user,” says Berger, professor of computer sciences in Manning College of Information and Computer Sciences. However, he also noted: “Python is insanely ineffective.”
To combat the inefficiency of Python, developers can use tools called “profilers”. Existing profilers, as a rule, do not particularly help programmers on Python. They simply indicate that a certain section of the code works slowly, leaving the developer one on one with a problem.
Scalene, created by the Berger command, is the first profile that not only exactly determines ineffective areas in the Python code, but also uses artificial intelligence to offer ways to improve the code.
“Scalene first finds out where your program spends the most time,” says Berger. The profile is focused on three key areas: CPU, GPU and use of memory.
After identifying the problem areas, Scalene uses AI to optimize specific lines or code blocks. “This is a control panel with recommendations”, Berger notes.
Scalene is already actively used and has been loaded more than 750,000 times from the date of its publication on GitHub. Work on this project was submitted at the annual Usenix conference, where it was awarded the award for the best article.