sebastien-doyon commented on PR #1269: URL: https://github.com/apache/maven/pull/1269#issuecomment-1760038298
Memory allocation profiling using [ConsoleMavenTransferListener_memalloc_Test.java](https://github.com/sebastien-doyon/maven/blob/MNG-7899_-_4_perf-tests/maven-embedder/src/test/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener_memalloc_Test.java) calling the ConsoleMavenTransferListener class 100 million times. This test shows a drastic decrease of : - char[] allocation (before : **190 GiB**, after : **85,4 GiB**) - java.lang.String allocation (before : **45,3 GiB**, after : **3,8 GiB**) - java.lang.StringBuffer allocation (before : **65,4 GiB**, after : **1,14 GiB**) - java.text.DecimalFormat allocation (before : **27,4 GiB**, after : **none recorded**) - more... Here the JMC capture for the initial code (file available [here](https://github.com/sebastien-doyon/maven/raw/MNG-7899_-_4_perf-tests/maven-embedder/recording-initial.jfr)) <img width="1237" alt="Capture d’écran 2023-10-12 à 18 52 20" src="https://github.com/apache/maven/assets/2573779/9ba678bd-d5bc-41c2-82d8-79f2984d880e"> Here the JMC capture for the optimised code (file available [here](https://github.com/sebastien-doyon/maven/raw/MNG-7899_-_4_perf-tests/maven-embedder/recording-optimized.jfr)) <img width="1237" alt="Capture d’écran 2023-10-12 à 18 52 30" src="https://github.com/apache/maven/assets/2573779/525eff55-386f-4175-805e-12d8d8b02ef7"> To reproduce: - checkout the [MNG-7899-profiling-initial](https://github.com/sebastien-doyon/maven/tree/MNG-7899-profiling-initial) tag - execute the following commands : ``` mvn clean verify -Drat.skip=true -DskipTests mvn test -Drat.skip=true -pl :maven-embedder -Dtest=**/ConsoleMavenTransferListener_memalloc_Test -Dspotless.check.skip ``` - open the `maven-embedder/recording-initial.jfr` file with JMC - checkout the [MNG-7899-profiling-optimised](https://github.com/sebastien-doyon/maven/tree/MNG-7899-profiling-optimised) tag - execute the following commands : ``` mvn clean verify -Drat.skip=true -DskipTests mvn test -Drat.skip=true -pl :maven-embedder -Dtest=**/ConsoleMavenTransferListener_memalloc_Test -Dspotless.check.skip ``` - open the `maven-embedder/recording-optimized.jfr` file with JMC -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org