-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix urlsplit #13
Merged
Fix urlsplit #13
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
734e3d7
fix failing test by importing
malloxpb e2abab6
import more variables to not fail the test
malloxpb 1ff8b35
test on py3 only for now
malloxpb 31e224c
decode the result to string on Python 3
malloxpb 23c8b3d
compile cython on py3
malloxpb 3d7eb0e
fix failing test by importing
malloxpb 95260b4
import more variables to not fail the test
malloxpb 790bd94
test on py3 only for now
malloxpb 168830f
decode the result to string on Python 3
malloxpb 89a71b3
compile cython on py3
malloxpb 6b76ede
Merge branch 'fix_tests' of https://github.com/nctl144/urlparse4 into…
malloxpb 1699be0
do not change test cases
malloxpb 978eada
decode result based on input types
malloxpb 3aa1b38
compile in py3
malloxpb af5eced
remove tests that are not related
malloxpb c351048
DRY code
malloxpb 5c28dd6
compile in py3
malloxpb 0924478
update the performance test
malloxpb 4165c4f
update the performance test
malloxpb 55de674
return based on input types (DRY)
malloxpb 3a034c2
recompile cython on py3
malloxpb 23e10ca
fix encoding urljoin without base
malloxpb 9a7d433
recompile cython
malloxpb 325b518
return username, password based on input
malloxpb 9d7f33b
recompile cython py3
malloxpb 0974a1e
reduce the performance test time
malloxpb 8c97272
update mozilla files from chromium
malloxpb f958e75
import func to compare scheme
malloxpb 66f4828
import scheme constants
malloxpb de26520
import the rest of the functions in urlparse
malloxpb efa4d52
Define isstandard func
malloxpb b51b05d
rename the file to its true name
malloxpb 9054383
delete the original file
malloxpb 253ff61
parse urls based on their type
malloxpb 757603f
compile cython py3
malloxpb 0a586b0
fix return error
malloxpb 6b55a9e
recompile cython py3
malloxpb 106eb0f
skip deprecated tests
malloxpb 21af6e9
skip other tests for now
malloxpb 15f6d2a
skip the quoter test
malloxpb 4712e73
put the test url back
malloxpb 9f3628f
add py3.5 to test
malloxpb 7144548
import func to compare scheme
malloxpb caaafef
import scheme constants
malloxpb 93bb8b3
import the rest of the functions in urlparse
malloxpb f36681f
Define isstandard func
malloxpb bc4253c
rename the file to its true name
malloxpb ad7de66
delete the original file
malloxpb 19126e2
parse urls based on their type
malloxpb 0bb23fa
compile cython py3
malloxpb 222a80c
fix return error
malloxpb dba7798
recompile cython py3
malloxpb 2de8884
recompile cython py3
malloxpb 9cb095b
Merge branch 'fix_split' of https://github.com/nctl144/urlparse4 into…
malloxpb 3effa97
recompile cython, resolve merge conflicts
malloxpb 0bc77f4
mark as todo
malloxpb 8f160ae
return result based on input type
malloxpb e0e4a97
compile cython
malloxpb 3c5f21c
skip mailto tests for now
malloxpb 3ece971
add note to discuss
malloxpb 507d427
remove deprecation tests
malloxpb 70da959
avoid repetition
malloxpb 455f810
avoid repetition and indentation
malloxpb 37f39c4
shorten the code
malloxpb 61de690
recompile cython py3
malloxpb f9bbeb3
rename variables
malloxpb eaec0a9
move code inside main func, move encode outside timer
malloxpb 9f1a6be
fallback to stdlib when failed to parse
malloxpb 4b7c716
recompile cython
malloxpb 89378bf
use argparse instead
malloxpb 7f57de6
indentation
malloxpb 5d66f3f
std split url based on input type
malloxpb 409129f
recompile Cython
malloxpb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,53 @@ | ||
from urlparse4 import urlsplit, urljoin | ||
from timeit import default_timer as timer | ||
|
||
total = 0 | ||
import argparse | ||
|
||
with open('urls/chromiumUrls.txt') as f: | ||
for url in f: | ||
|
||
start = timer() | ||
def main(): | ||
parser = argparse.ArgumentParser(description='Measure the time of urlsplit and urljoin') | ||
parser.add_argument('--encode', action='store_true', | ||
help='encode the urls (default: False)') | ||
args = parser.parse_args() | ||
|
||
a = urlsplit(url) | ||
encode = args.encode | ||
|
||
end = timer() | ||
urlsplit_time = 0 | ||
|
||
total += end - start | ||
for i in range(5): | ||
with open('urls/chromiumUrls.txt') as f: | ||
for url in f: | ||
if encode: | ||
url = url.encode() | ||
|
||
print("the total time is", total, "seconds") | ||
start = timer() | ||
a = urlsplit(url) | ||
end = timer() | ||
|
||
urlsplit_time += end - start | ||
|
||
print("the urlsplit time with encode in python is", urlsplit_time / 5, "seconds") | ||
|
||
|
||
urljoin_time = 0 | ||
|
||
for i in range(5): | ||
with open('urls/chromiumUrls.txt') as f: | ||
for url in f: | ||
partial_url = "/asd" | ||
|
||
if encode: | ||
url = url.encode() | ||
partial_url = partial_url.encode() | ||
|
||
start = timer() | ||
a = urljoin(url, partial_url) | ||
end = timer() | ||
|
||
urljoin_time += end - start | ||
|
||
print("the urljoin time with encode in python is", urljoin_time / 5, "seconds") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this file is changes so heavily in this PR, maybe also move all code into some function, e.g.
main
, and call it at the end? There are two reasons:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense! I will move all the code inside a main() func