The current implementation uses a linear search of the list when searching for domains. However, it is too slow when it contains a lot of elements like the .jp domain.
This PR uses a tree data structure to speed up searches by 1,500% - 2,500% . These are benchmarks:
The current implementation uses a linear search of the list when searching for domains. However, it is too slow when it contains a lot of elements like the
.jp
domain.This PR uses a tree data structure to speed up searches by 1,500% - 2,500% . These are benchmarks:
on https://github.com/rushmorem/publicsuffix/commit/832f35c9bac54c54d0ae4c38e821f29ce985a322 :
on https://github.com/rushmorem/publicsuffix/commit/fe2fc1e4d9615eb40bf7a72a0d444bf770de22b8 :