forked from ulfalizer/Kconfiglib
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
cd30ee8
commit 4da9343
Showing
6 changed files
with
62 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
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,2 @@ | ||
FOO = y | ||
BAR = y |
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 @@ | ||
[kconfig_import("config.py") for _ in range(100)] |
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,2 @@ | ||
for _ in range(1): | ||
FOO.val = not FOO.val |
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,2 @@ | ||
for _ in range(100): | ||
FOO.val = not FOO.val |
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 @@ | ||
import os | ||
import glob | ||
import kconfiglib | ||
import pytest | ||
|
||
CUR_DIR = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
def test_bench_config(benchmark): | ||
"""Evaluate the performance standard config file.""" | ||
kconfig_path = CUR_DIR + '/Kconfig' | ||
|
||
kconf = kconfiglib.Kconfig(kconfig_path) | ||
benchmark(kconf.load_config, filename=CUR_DIR + '/app.config') | ||
|
||
|
||
def test_bench_configpy(benchmark): | ||
"""Evaluate the performance python config.""" | ||
kconfig_path = CUR_DIR + '/Kconfig' | ||
|
||
kconf = kconfiglib.Kconfig(kconfig_path) | ||
benchmark(kconf.load_config, filename=CUR_DIR + '/config.py') | ||
|
||
|
||
def test_bench_import_configpy(benchmark): | ||
"""Evaluate the performance of importing.""" | ||
kconfig_path = CUR_DIR + '/Kconfig' | ||
|
||
kconf = kconfiglib.Kconfig(kconfig_path) | ||
benchmark(kconf.load_config, filename=CUR_DIR + '/config.import.py') | ||
|
||
|
||
def test_bench_import100_configpy(benchmark): | ||
"""Evaluate the performance of importing foo 100 times.""" | ||
kconfig_path = CUR_DIR + '/Kconfig' | ||
|
||
kconf = kconfiglib.Kconfig(kconfig_path) | ||
benchmark(kconf.load_config, filename=CUR_DIR + '/config.import100.py') | ||
|
||
|
||
def test_bench_config1_configpy(benchmark): | ||
"""Evaluate the performance of setting foo 1 time.""" | ||
kconfig_path = CUR_DIR + '/Kconfig' | ||
|
||
kconf = kconfiglib.Kconfig(kconfig_path) | ||
benchmark(kconf.load_config, filename=CUR_DIR + '/config1.py') | ||
|
||
|
||
def test_bench_config100_configpy(benchmark): | ||
"""Evaluate the performance of setting foo 100 times.""" | ||
kconfig_path = CUR_DIR + '/Kconfig' | ||
|
||
kconf = kconfiglib.Kconfig(kconfig_path) | ||
benchmark(kconf.load_config, filename=CUR_DIR + '/config100.py') |