Closed ZzZombo closed 1 year ago
The slowness is due to a bug in the fix for #68. The result is that although the PAC file executes successfully for IP hosts, it tries to resolve the IP for host false
9 times, each time it's called. I'll revise isInNet()
to return False immediately for falsey hostnames, which will avoid this problem.
Hey, thanks for letting me know! I did know something was wrong with the update, just not what exactly! Your reply has saved me from endless hair splitting because my application started to crash out of the blue since then, and even when not, its performance has severely degraded nearly to the point of hanging. I've fixed locally the function you pointed out and so far it's been very well.
Actually, upon further testing, my euphoria was premature. I had to scrap use of this package because it caused crashes in the application under heavy load, w/o any traceable errors. Just silent crashes. W/o the fix it used to crash as well very frequently, seemingly after it stopped to, but it did continue to do so, just at a vastly reduced rate. It's just a guess it's tied to the load on the application, connecting the dots, given it crashed very frequently w/o the fix and crashes way less frequently w/ it applied.
That's too bad. I haven't heard of such instability. If you ever come across the cause or a trace, please file an issue.
I just realized the check I uncommented in #68 breaks my application in more ways. For some reason the same PAC script, if subjected to the check, takes exceedingly long time to complete, crippling performance. I suppose it's not the problem in
pypac
rather in the script, but given it appears it works OK on real URLs, so I'd like to make the validation optional.