MCPcopy Create free account
hub / github.com/apache/fory / render_plot

Function render_plot

benchmarks/swift/benchmark_report.py:211–226  ·  view source on GitHub ↗
(results: dict, output_dir: str)

Source from the content-addressed store, hash-verified

209
210
211def render_plot(results: dict, output_dir: str) -> str:
212 fig, axes = plt.subplots(2, 3, figsize=(16.5, 9.0))
213 fig.suptitle(
214 "Swift Serialization Throughput", fontsize=15, fontweight="normal", y=0.955
215 )
216
217 for index, (ax, datatype) in enumerate(zip(axes.flat, DATATYPE_ORDER)):
218 plot_group(ax, results, datatype)
219 if index % 3 == 0:
220 ax.set_ylabel("Throughput (ops/sec)", labelpad=10)
221
222 fig.tight_layout(rect=[0.02, 0.02, 0.995, 0.965], w_pad=1.2, h_pad=1.25)
223 output_path = os.path.join(output_dir, "throughput.png")
224 save_benchmark_figure(fig, output_path)
225 plt.close(fig)
226 return output_path
227
228
229def winner_cell(throughputs: dict) -> str:

Callers 1

mainFunction · 0.70

Calls 3

save_benchmark_figureFunction · 0.90
plot_groupFunction · 0.70
closeMethod · 0.45

Tested by

no test coverage detected