python-nginx
python-nginx copied to clipboard
When the Nginx configuration file is too large, the loading speed is extremely slow.
I've observed that the code uses data[index:] for regular expression matching on each occasion. When dealing with a very large Nginx configuration file, for instance, one with tens of thousands of lines, the loading speed can be significantly slow, sometimes taking several hours to complete. I improved this by optimizing A slice of 1000, which greatly increases the parsing speed. A slice of 1000 is typically adequate to fulfill the parsing requirements.