chore: Change Scala native's release mode to ReleaseFull#395
Merged
stephenamar-db merged 1 commit intodatabricks:masterfrom May 21, 2025
Merged
chore: Change Scala native's release mode to ReleaseFull#395stephenamar-db merged 1 commit intodatabricks:masterfrom
stephenamar-db merged 1 commit intodatabricks:masterfrom
Conversation
Contributor
Author
Test with ReleaseFull
hepin@Mac ~ % hyperfine --warmup 10 "./out cmp.jsonnet"
Benchmark 1: ./out cmp.jsonnet
Time (mean ± σ): 252.8 ms ± 4.2 ms [User: 137.3 ms, System: 12.2 ms]
Range (min … max): 249.0 ms … 264.2 ms 10 runs
Test with ReleaseFast
hepin@Mac ~ % hyperfine --warmup 10 "./sjsonnet cmp.jsonnet"
Benchmark 1: ./sjsonnet cmp.jsonnet
Time (mean ± σ): 225.9 ms ± 2.5 ms [User: 138.9 ms, System: 12.0 ms]
Range (min … max): 222.3 ms … 229.1 ms 11 runsSeems ReleaseFull is slower for a one-time command app? @WojciechMazur |
stephenamar-db
approved these changes
May 19, 2025
Collaborator
|
Is this ready |
Contributor
Author
|
@stephenamar-db But the result binary size is bigger, and the benchmark for a single run is slower. |
Collaborator
|
it probably takes longer to load the large binary in memory? |
Contributor
Author
|
@stephenamar-db I think so. |
Not sure how MacOS disk caching works, but hyperfine --warmup should remove all the difference in loading times |
Contributor
Author
|
@CertainLach Thanks, I saw scalafmt is using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation:
Better performance
refs: https://scala-native.org/en/stable/user/sbt.html#compilation-modes
Maybe because of the sjsonnet size is now from
7.2MBto12MBit's https://github.com/scalameta/scalafmt/blob/main/build.sbt#L342 ReleaseFull in scalafmt