# Prepare Environment ## JDK Here's an example of an openjdk11 installation. ```sh sudo apt update sudo apt install openjdk-11-jdk ``` The completion of the installation can be checked by the following command. ```sh javac --version ``` The output looks like this: ```sh javac 11.0.21 ``` ## d8 The d8 tool is included as a standalone tool in the Android Studio build tool version 28.0.1 and higher. Therefore, you can get the d8 tool by downloading and installing the Android Studio tools. 1. Download Android Studio: ```sh wget https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2023.2.1.24/android-studio-2023.2.1.24-linux.tar.gz ``` 2. Decompress ```sh tar -xzvf android-studio-2023.1.1.28-linux.tar.gz ``` 3. Launch Android Studio ```sh cd android-studio/bin ./studio.sh ``` 4. Configure a domestic mirror source (If you are prompted to download the Android SDK at this point) + Go to the main Android Studio page and click on the lower button: `More Actions` -> `SDK Manager`。 + Find the left side: `Appearance & Behavior` -> `System Settings` -> `HTTP Proxy`。 + Select `Auto-detect proxy settings`,And then check `Automatic proxy configuration URL`。Fill in the mirror source address in the input box at the end, the optional URLs of the mirror source are as follows: ```sh https://mirrors.aliyun.com/android.googlesource.com/ https://mirrors.cloud.tencent.com/AndroidSDK/ ``` Then restart Android Studio to download the Android SDK without any problems. Android SDK Path: `~/root/Android/Sdk/build-tools/`. The d8 executable program is located in the version number directory of the directory. # Introduction Generate a comparison report of bytecode file sizes generated by es2abc / es2abc / javac and d8 compilation for the js / ts / java test cases, respectively. # Running the Script ## Usage ```sh python3 size_compare.py --es2abc-path ES2ABC_PATH --javac-path JAVAC_PATH [arguments] ``` ### Tail arguments - `--es2abc-path`: Path to the executable program es2abc. - `--javac-path`: Path to the executable program javac. ### Optional arguments - `--d8-path`: Path to the executable program d8. - `--timeout`: Time limits for use case execution (In seconds). # Test Result Bytecode file size comparison report: `./size_comparison_report.html`