Uh oh!
There was an error while loading. Please reload this page.
fix: reduce memory footprint when loading TLDs - #362
Conversation
https://build.opensuse.org/request/show/1170193 by user mia + anag+factory - Update to 0.28.1 * fix: reduce memory footprint when loading TLDs gh#python-validators/validators#362 * fix: rfc cases in the domain validator gh#python-validators/validators#367 * chore: documentation maintenance gh#python-validators/validators#368
salty-horse
commented
Jul 16, 2024
This significantly slows down TLD lookup. Opening a file and scanning it for every email validation is very inefficient. Is the memory footprint that much of a concern? Would you be open to changing it back to something like this, which is 10 times faster? _iana_tld_set=Nonedef_iana_tld():
global_iana_tld_setif_iana_tld_set:
return_iana_tld_setwithPath(__file__).parent.joinpath("_tld.txt").open() astld_f:
_=next(tld_f)
_iana_tld_set= {line.strip() forlineintld_f}
return_iana_tld_set |
nandgator
commented
Jul 16, 2024
That's true for repeated validations.
Yes, if the file is too, large and/or, system memory is insufficient. What about a It will load and store the TLDs once. If that method isn't called, it'll lookup the file every time. Associate that method with a A PR is welcome. |
No description provided.