Skip to content

Commit 018a543

Browse files
committed
Added Benchmarks Corresponding to various test cases
Signed-off-by: ms2892 <msadiq074@gmail.com>
1 parent c5b1592 commit 018a543

10 files changed

Lines changed: 3120 additions & 78 deletions

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,8 @@ dmypy.json
165165

166166
# Cython debug symbols
167167
cython_debug/
168+
169+
# Benchmarks created my asv
170+
pystack/**
171+
.asv/**
172+
.vscode/**

.vscode/settings.json

Lines changed: 0 additions & 78 deletions
This file was deleted.

asv.conf.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"version":1,
3+
"benchmark_dir": "./benchmarks",
4+
"repo":"git@github.com:ms2892/pystack.git",
5+
"project": "pystack",
6+
"project_url": "https://github.com/ms2892/pystack",
7+
"env_dir":".asv/env",
8+
"results_dir":".asv/results",
9+
"html_dir":".asv/html",
10+
"environment_type":"conda",
11+
"dvcs":"git",
12+
"branches":["main"],
13+
"install_command":[
14+
"python -mpip install -r requirements-test.txt -r requirements-extra.txt",
15+
"python -mpip install -e ."
16+
],
17+
"build_command":[
18+
"python -mpip install pkgconfig",
19+
"python -mpip install dbg"
20+
]
21+
}

benchmarks/__init__.py

Whitespace-only changes.

benchmarks/benchmark_colors.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
from pystack.colors import *
2+
3+
RANGE=100
4+
5+
class ColorsBenchmarkSuite:
6+
7+
def setup(self):
8+
pass
9+
10+
def time_colored(self):
11+
colors = ["red","green","yellow","blue","magenta","cyan","white"]
12+
highlights = ["on_red","on_green","on_yellow","on_blue","on_magenta","on_cyan","on_white"]
13+
attributes = ["bold", "dark", "underline", "blink", "reverse", "concealed"]
14+
for counter in range(RANGE):
15+
for color in colors:
16+
for highlight in highlights:
17+
colored("Benchmark Colored",color,highlight,attributes)
18+
return "Successfully Benchmarks colored"
19+
20+
def time_format_colored(self):
21+
colors=[
22+
"grey",
23+
"red",
24+
"green",
25+
"yellow",
26+
"blue",
27+
"magenta",
28+
"cyan",
29+
"white",
30+
]
31+
highlights=[
32+
"on_grey",
33+
"on_red",
34+
"on_green",
35+
"on_yellow",
36+
"on_blue",
37+
"on_magenta",
38+
"on_cyan",
39+
"on_white",
40+
]
41+
attributes=[
42+
"bold",
43+
"faint",
44+
"italized",
45+
"underline",
46+
"blink",
47+
"reverse",
48+
"concealed",
49+
]
50+
for counter in range(RANGE):
51+
for color in colors:
52+
for highlight in highlights:
53+
format_colored("Benchmark Format Colored",color,highlight,attributes)
54+
return "Successfully Benchmarks format_colored"

0 commit comments

Comments
 (0)