https://github.com/khbminus/code-size-profiler
https://github.com/khbminus/code-size-profiler
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/khbminus/code-size-profiler
- Owner: khbminus
- Created: 2023-06-28T16:15:13.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-31T17:08:28.000Z (almost 3 years ago)
- Last Synced: 2025-10-21T14:44:56.478Z (9 months ago)
- Language: Kotlin
- Size: 183 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/khbminus/code-size-profiler/actions/workflows/qodana.yaml)
To run this script, you need to generate dumps with the patched compiler (currently branch `dce-info-json-fix`).
How to use:
```shell
$ ./run.sh -e kotlin.test -e -e \
\
\
```
The script also could be used in one-dump mode:
```shell
$ ./run.sh [-e [-e ...]]
```
Use `-e` flag to filter dump for some fqns.
This builds traversable graphs and treemaps (for left and right dumps), treemap of difference,
difference of dominator trees and traversable difference of graphs. Moreover, it generates table of differences.
After it, you can start server with `scripts/server.sh` file.
# Graph Compression
You can use `filter-variable` command from kotlin application (by `./gradlew run --args='filter-variable'`) to compress
DCE graph by removing variables and value parameters from edges. It stores the semantic by changing source vertexes of
edges going from variables.
# Traverse Graph
This page allows seeing the DCE graph structure.
The node is referring to the IR size of the node.
To start:
* check some nodes in the menu on the right (NB: the search bar could
lag, since it filters with common linear string comparison algorithm)
* Select the desirable maximum depth. Be careful, the high depth may freeze the page.
# Zoomable treemap
The treemap allows seeing the size ratio between your code. All elements of IR dump split by FQN. To go deeper, click on
the element. To go back, click on the name above.
The right panel is used for filtering & choosing the size mode.
# Sourcemap
A page inspired by [Godbolt](https://godbolt.org). The page has two sides: on the left there are several kotlin files (
use the selector to choose the right one). The right side has a WAT text of compiled .wasm file. On hover in colored
area the other side will scroll to chosen color.
To compile this page use `generate-source-map script`: