Skip to content

Commit 57db258

Browse files
committed
chore: adjust report styling
1 parent a798937 commit 57db258

12 files changed

+18
-4
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
At [Softnetics Team](https://www.softnetics.tech/), we specialize in building software using TypeScript. Data validation is a crucial part of our work, as we need to verify and convert user input into the correct format. Initially, we chose [Zod](https://zod.dev/) as our schema validation library. However, as our applications grew larger, we noticed high CPU and memory usage during TypeScript compilation, particularly in development. Our research revealed that these performance issues stemmed from the validation library itself. This led us to conduct a benchmark study comparing CPU and memory usage across different schema validation libraries.
44

5+
# NOTE
6+
7+
> [!WARNING]
8+
> The summary will be updated in the future (due to the upcoming release of Zod 4).
9+
510
# Table of Contents <!-- omit in toc -->
611

12+
- [NOTE](#note)
713
- [Environment](#environment)
814
- [System Information](#system-information)
915
- [Library Version](#library-version)

reports/__assets__/check_time.png

-23.2 KB
Loading

reports/__assets__/files.png

-25.7 KB
Loading

reports/__assets__/i_o_read_time.png

-19.7 KB
Loading

reports/__assets__/identifiers.png

-30.2 KB
Loading

reports/__assets__/memory_used.png

-29.3 KB
Loading

reports/__assets__/parse_time.png

-22.8 KB
Loading

reports/__assets__/program_time.png

-26.3 KB
Loading

reports/__assets__/symbols.png

-24.5 KB
Loading

reports/__assets__/total_time.png

-26 KB
Loading

reports/__assets__/types.png

-23.9 KB
Loading

reports/benchmark_plotter.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,25 @@ def _plotMetric(self, metricName: str, unit: str):
4646
df = df.sort_values(by=[metricName], ascending=False)
4747
grouped = df.groupby(by=["Name"])
4848

49-
fig = plt.figure(figsize=(8, 15))
49+
ncols = 2
50+
nrows = len(grouped) // ncols + len(grouped) % ncols
51+
fig, axes = plt.subplots(ncols=ncols, nrows=nrows, figsize=(ncols * 8, nrows * 2.4))
5052
fig.suptitle(f"{metricName} comparison", fontsize=24)
5153

54+
# Clear axes
5255
for i, (names, group) in enumerate(grouped):
53-
ax = plt.subplot(len(grouped), 1, i + 1)
56+
ax = axes[i // ncols, i % ncols]
5457
colors = [self.colorMap[lib] for lib in group["Library"]]
5558
ax.barh(y=group["Library"], width=group[metricName], color=colors)
5659
ax.set_title(names[0])
5760
ax.set_xlabel(unit)
58-
ax.plot()
61+
62+
remaining = len(grouped) % ncols
63+
for i in range(remaining):
64+
# Remove empty axes
65+
ax = axes[nrows-1, ncols-i-1]
66+
fig.delaxes(ax)
5967

6068
fileName = metricName.replace(" ", "_").replace("/", "_").lower()
61-
plt.subplots_adjust(wspace=0, hspace=0.8)
69+
plt.subplots_adjust(wspace=0.2, hspace=1)
6270
plt.savefig(os.path.join(self.dir, f"{fileName}.png"))

0 commit comments

Comments
 (0)