Created
March 7, 2014 06:01
-
-
Save yeonsh/9406018 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import tldextract | |
from tld import get_tld | |
from tld.utils import update_tld_names | |
TEST_COUNT = 1000000 | |
start_time = os.times()[4] | |
for i in range(TEST_COUNT): | |
e = tldextract.extract('http://forums.news.cnn.com:8080/a/b/c/') | |
d = e.domain + '.' + e.suffix | |
#print d | |
finish_time = os.times()[4] | |
print finish_time - start_time | |
start_time = os.times()[4] | |
update_tld_names() | |
for i in range(TEST_COUNT): | |
d = get_tld('http://forums.news.cnn.com:8080/a/b/c/') | |
#print d | |
finish_time = os.times()[4] | |
print finish_time - start_time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment