In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to analyze the vectorcall in Python 3.9 performance optimization, I believe that many inexperienced people do not know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Version 3.9.0 of Python is under development and the final version is planned for 2020-10-05.
Officials have disclosed many details in changelog, one of which is the "vectorcall" feature that is the most acceptable.
In fact, vectorcall has been partially implemented as early as version 3.8 of Python, but it is temporary and hidden, and it is scheduled to be implemented in version 3.9. The following figure is an introduction in version 3.8:
So, what is vectorcall? What changes will it bring?
"a fast calling protocol for CPython", which is a fast invocation protocol for CPython, can accelerate the speed of the CPython interpreter when calling class objects.
(PS: it should be noted that the "protocol" here is a broad term, which, unlike the network protocol or communication protocol we are familiar with, can be understood as a convention or an implementation when calling the code.)
This protocol was proposed in PEP-590 (time is 2019-03-29), and the corresponding bpo is issue37207, which took nearly a year to develop, and its implementation has been integrated into the code warehouse.
Summing up its core point in one sentence is that it will speed up calls to major types such as list (), tuple (), dict (), and so on, and it can also be used on custom classes.
Combining PEP and bpo information, I abstracted the following detailed points:
Vectorcall is the formalization of fastcall. There were some sporadic optimization points (fastcall) in the previous CPython, but now officials have systematized them and given a formal name of "vectorcall".
Vectorcall is suitable for most built-in types. According to the current disclosure, it applies to the six main built-in types: list, tuple, dict, set, frozenset and range (some measurements show a speed increase of 10% to 30%).
Vectorcall is a compromise of performance and flexibility. The previous interpreter has a high degree of flexibility, but there are unnecessary intermediate objects and indirect call overhead in the process of object invocation, which is now managed to eliminate this overhead and improve the performance.
After reading the above, have you mastered how to analyze vectorcall in Python 3.9 performance optimization? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.