-
Notifications
You must be signed in to change notification settings - Fork 11
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
Efficient version ranges #14
Open
krishgalani
wants to merge
9
commits into
iamdual:master
Choose a base branch
from
krishgalani:efficient-version-ranges
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
version-range queries, I believe this is not neccesary, as you have to store more overhead. Currently we have O(|versions|) per query regardless of if a recent generate with the same browser/platform version_ranges provided. This is evident in the VersionRanges class filter method. I have modified the initialization module (where the generate method is) to dynamically initialize index maps at most once per type of browser/platform range specified. This initialization direcly modifies a index map field in the browsers/platforms modules which remains throughout generates. This reduces the time complexity from O(|versions|) per query to O(|versions|) on the first, and O(1) for the rest. This is to be expected for a ua-generator, as it is commonly used as a small piece of many webscraping algorithms. Changes: Initialize the relevant index map when the version_ranges feature is used. Use index-maps for faster version filtering. Provide error checking for version correctness instead of ignoring the error. This means creating a new exception for invalid version. A unit test of the functionality. (I also did some print statement tests)
Hello, I will take a look when I find time, but doesn't seem urgent. 🤔 |
…d appropriate unit tests
…roid_pixel), wouldn't be recognized by generator and throw an error, this is an extension to allowing the user to specify a specific android platform or version. At the same time produce more verbose generator errors (this means adding to_string methods in Version, VersionRange, and Options). Finally add a constant ANDROIDS containing all the possible android platforms that can be specified, 'android' is still supported, and a specific platform will be chosen for the user
… once at import, instead of across generates. Also include better type checking for version_ranges
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Please read commit logs for verbose changes!
let me know your thoughts :) @iamdual
modified one test and added a new unit test