-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ms2892/add-benchmarks
Add benchmarks
- Loading branch information
Showing
11 changed files
with
3,154 additions
and
78 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 |
---|---|---|
|
@@ -165,3 +165,8 @@ dmypy.json | |
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# Benchmarks created my asv | ||
pystack/** | ||
.asv/** | ||
.vscode/** |
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
{ | ||
"version":1, | ||
"benchmark_dir": "./benchmarks", | ||
"repo":"[email protected]:bloomberg/pystack.git", | ||
"project": "pystack", | ||
"project_url": "https://github.com/bloomberg/pystack", | ||
"env_dir":".asv/env", | ||
"results_dir":".asv/results", | ||
"html_dir":".asv/html", | ||
"environment_type":"conda", | ||
"dvcs":"git", | ||
"branches":["main"], | ||
"install_command":[ | ||
"python -mpip install -r requirements-test.txt -r requirements-extra.txt", | ||
"python -mpip install -e ." | ||
], | ||
"build_command":[ | ||
"python -mpip install pkgconfig", | ||
"python -mpip install dbg" | ||
] | ||
} |
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,34 @@ | ||
# Using the Benchmarking Tool | ||
|
||
One of the prerequisites is to have the respective libraries installed. Hence do install the following libraries | ||
|
||
- libdw | ||
- libelf | ||
|
||
These can be installed via the command `apt-get install libdw-dev libelf-dev`. | ||
|
||
To benchmark the packages present another tool is used called `airspeed velocity`. To install it please run the follow command | ||
|
||
```pip install asv``` | ||
|
||
In the parent directory run the following command to get a brief benchmark of your current packages | ||
|
||
```asv run``` | ||
|
||
Use the `-v` flag to get a verbose output. | ||
|
||
To compare the all the commits across all the branches you may make use of the following command. | ||
|
||
```asv run ALL``` | ||
|
||
To run benchmarks from a particular commit or tag you can use the commit hash or the tag | ||
|
||
```asv run [TAG|HASH]..[branch]``` | ||
|
||
To compare between tags | ||
|
||
```asv show [TAG]..[branch]``` | ||
|
||
To have a local server to display all the graphs | ||
|
||
```asv publish``` |
Empty file.
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,54 @@ | ||
from pystack.colors import * | ||
|
||
RANGE=100 | ||
|
||
class ColorsBenchmarkSuite: | ||
|
||
def setup(self): | ||
pass | ||
|
||
def time_colored(self): | ||
colors = ["red","green","yellow","blue","magenta","cyan","white"] | ||
highlights = ["on_red","on_green","on_yellow","on_blue","on_magenta","on_cyan","on_white"] | ||
attributes = ["bold", "dark", "underline", "blink", "reverse", "concealed"] | ||
for counter in range(RANGE): | ||
for color in colors: | ||
for highlight in highlights: | ||
colored("Benchmark Colored",color,highlight,attributes) | ||
return "Successfully Benchmarks colored" | ||
|
||
def time_format_colored(self): | ||
colors=[ | ||
"grey", | ||
"red", | ||
"green", | ||
"yellow", | ||
"blue", | ||
"magenta", | ||
"cyan", | ||
"white", | ||
] | ||
highlights=[ | ||
"on_grey", | ||
"on_red", | ||
"on_green", | ||
"on_yellow", | ||
"on_blue", | ||
"on_magenta", | ||
"on_cyan", | ||
"on_white", | ||
] | ||
attributes=[ | ||
"bold", | ||
"faint", | ||
"italized", | ||
"underline", | ||
"blink", | ||
"reverse", | ||
"concealed", | ||
] | ||
for counter in range(RANGE): | ||
for color in colors: | ||
for highlight in highlights: | ||
format_colored("Benchmark Format Colored",color,highlight,attributes) | ||
return "Successfully Benchmarks format_colored" |
Oops, something went wrong.