Make benchmark graph extensible and add more bars #1080
+163
−137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I want to visualize the results of multiple benchmarks in a graph. However, the subplot layout, along with many magic constants, is almost hard-coded. And as mentioned in the comments of run.sh, it is not possible to add a sufficient number of bar graphs.
I replaced the graph library from matplotlib to plotly and made modifications, to reduce magic constants and to make it easier to expand. I also introduced type hints in the Python code.
The attached image is an example when including all bar graphs. But I don't have a native Linux box, so the benchmark result graph could not be included in the PR. It was executed on WSL.
![plot](https://private-user-images.githubusercontent.com/16424085/297374228-102d55e5-00b0-497c-bbbe-64cb392e8a93.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3ODgzNTMsIm5iZiI6MTczOTc4ODA1MywicGF0aCI6Ii8xNjQyNDA4NS8yOTczNzQyMjgtMTAyZDU1ZTUtMDBiMC00OTdjLWJiYmUtNjRjYjM5MmU4YTkzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE3VDEwMjczM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM1MGE2MGJlM2E5NGFjOTA4M2RjNTAxYzI5ZDRkMmI4YjRmOGNjZjRkMDhkOTRkYTY0NDIxYmE2OTQ5MDVmNTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.YQbFEnaJ4iBYs1pLxG-m_HSHP9qnU7J128utbyx2l1I)
The first commit only contains format change without altering any code, you can skip it and read the second one.(3b0732b)