perf-labs 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
perf/__init__.py ADDED
@@ -0,0 +1,52 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2026 Kris Jusiak <kris@jusiak.net>
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ import logging as _logging
24
+ from types import SimpleNamespace as _SimpleNamespace
25
+
26
+ _logging.getLogger("angr.state_plugins.unicorn_engine").setLevel(_logging.CRITICAL)
27
+
28
+ from . import plot as _plot # noqa: E402
29
+ from .bench import benchmark # noqa: E402
30
+ from .cmp import compare # noqa: E402
31
+ from .info import cpuinfo as _cpuinfo # noqa: E402
32
+ from .mca import analyze # noqa: E402
33
+ from .opt import optimize # noqa: E402
34
+ from .prof import profile # noqa: E402
35
+ from .tune import ( # noqa: E402
36
+ status as _status,
37
+ test as _test,
38
+ tune as _tune,
39
+ )
40
+
41
+ system = _SimpleNamespace(info=_cpuinfo, status=_status, tune=_tune, test=_test)
42
+ __all__ = [
43
+ "system",
44
+ "benchmark",
45
+ "profile",
46
+ "analyze",
47
+ "compare",
48
+ "optimize",
49
+ "plot",
50
+ ]
51
+
52
+ plot = _plot.PlotConfig()
perf/arch/__init__.py ADDED
@@ -0,0 +1,58 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2026 Kris Jusiak <kris@jusiak.net>
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ import platform
24
+
25
+ from . import x86_64
26
+
27
+ __all__ = ["arch", "x86_64"]
28
+ _ARCHES = {
29
+ "x86-64": x86_64,
30
+ "x86_64": x86_64,
31
+ "amd64": x86_64,
32
+ }
33
+
34
+
35
+ def arch(name=None):
36
+ if name is None:
37
+ name = platform.machine()
38
+ try:
39
+ inner = getattr(name, "arch", None)
40
+ if inner is not None:
41
+ candidate = getattr(inner, "name", None)
42
+ if isinstance(candidate, str) and candidate:
43
+ name = candidate
44
+ else:
45
+ name = inner
46
+ elif not isinstance(name, str):
47
+ candidate = getattr(name, "name", None)
48
+ if isinstance(candidate, str) and candidate:
49
+ name = candidate
50
+ except Exception:
51
+ pass
52
+ arch = _ARCHES.get(str(name).lower())
53
+ if arch is None:
54
+ raise ValueError(
55
+ f"unsupported architecture {name!r}; supported: "
56
+ f"{', '.join(sorted(_ARCHES))}"
57
+ )
58
+ return arch