-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
815 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pathlib | ||
|
||
import pyperf | ||
from ua_parser.user_agent_parser import Parse, _PARSE_CACHE | ||
|
||
|
||
f = pathlib.Path(__file__).parent / 'useragents.txt' | ||
uas = f.read_text('utf-8').splitlines(keepends=False) | ||
|
||
runner = pyperf.Runner() | ||
runner.timeit("legacy", """ | ||
for ua in uas: | ||
Parse(ua) | ||
""", "from __main__ import Parse, uas, _PARSE_CACHE") | ||
|
Oops, something went wrong.