Skip to content

Conversation

@valdisxp1
Copy link
Contributor

@valdisxp1 valdisxp1 commented Sep 23, 2018

  • Generates multiple charts and a report in markdown (md)
  • Add command line arguments to both run.py and summary.py. This makes testing the performance of new features easier (see Readme.md).

See example report:
https://github.com/valdisxp1/scala-native-benchmark-results/blob/gh-pages/reports/summary_20180923_222231_scala-native-0.3.8_vs_scala-native-0.3.9-SNAPSHOT/Readme.md

@densh
Copy link
Member

densh commented Sep 25, 2018

Version comparison is extremely valuable, well done!

The numbers look really srange though, 3-5x degradation from version to version looks like either debug mode or boehm gc.

@valdisxp1
Copy link
Contributor Author

I will double-check that I do not have any debugging enabled by accident and re-run it tonight.

@valdisxp1 valdisxp1 force-pushed the compare-3.8.5-with-master branch from 2b8cd6a to 6800fd5 Compare September 25, 2018 11:47
@densh
Copy link
Member

densh commented Sep 27, 2018

@valdisxp1 Indeed, master regressed wrt 0.3.8. I did manual bisect based first few benchmarks and found that it regressed in scala-native/scala-native#1295. The issue is that we used to do DCE after lowering and before codegen and that PR mistakenly removed it.

@valdisxp1
Copy link
Contributor Author

Including more changes #4 and automation stuff.
Comparing your changes against master is as easy as:

  1. have scala-native and scala-native-benchmarks in the same parent directory
  2. from scala-native-benchmarks
scripts/run.py latest@master latest@my-branch
scripts/summary latest@master latest@my-branch

@valdisxp1 valdisxp1 changed the title Generate reports [DO NOT MERGE] Generate reports May 12, 2019
@valdisxp1
Copy link
Contributor Author

Splitting the code into smaller PRs and improving code quality.
#6 #7
This branch has most of the things working, but the code is not clean or very readable.

@valdisxp1 valdisxp1 closed this May 12, 2019
densh pushed a commit to scala-native/scala-native that referenced this pull request Jul 17, 2019
Features:
- New `SCALANATIVE_GC` option  `commix` to enable the new GC changes.
- Concurrent, parallel sweep. Reduced GC pause times by utilizing additional processor cores during sweeping.
- Parallel mark. Reduces GC pause times by utilizing additional processor cores during marking.
- Configurable number of GC threads with `SCALANATIVE_GC_THREADS` environment variable. Set to number of available processors - 1 up to 8, but no less than 1.
- Increasing heap size until mark is <=5% of total time. This can be adjusted with `SCALANATIVE_TIME_RATIO`. I.e. `export SCALANATIVE_TIME_RATIO=0.03` for <= 3%.
- Added an option the change the minimum free block ratio `SCALANATIVE_FREE_RATIO`. If there are not enough free blocks after a garbage collection it will increase the heap size.
- The minimum heap size setting renamed from `SCALANATIVE_MIN_HEAP_SIZE` to a shorter `SCALANATIVE_MIN_SIZE`. Updated Immix to match.
- The maxium heap size setting renamed from `SCALANATIVE_MAX_HEAP_SIZE` to a shorter `SCALANATIVE_MAX_SIZE`. Updated Immix to match.
### Changes to GC Statistics
- Stat collection disabled by default to reduce code size. They can be enabled by compiler arguments. See example and table below.
- Stats changed to event-based CSV format.
- Stats now also saves events for collection start and end.
- Stats includes `start_ns` column - time in nanoseconds since application was started.
- Stats is compatible with the new concurrent sweep events.
 Multiple verbosity levels of enabled for stats with compiler arguments. For example:
```scala
nativeCompileOptions += "-DENABLE_GC_STATS_BATCHES"
```

> scala-native-benchmarks flags as per suggested changes in scala-native/scala-native-benchmarks#3
> results size for default tests when doing a single run `--runs 1` instead of the default which is 20.

Internals:
- thread-safe `BlockList`s
- thread-safe `BlockRange`s
- thread-safe block counts
- thread-safe `GreyList`s
- new block flags in `BlockMeta`
- removed marking `Stack`s

Debugging :
- asserts in Immix can now be enabled by setting `DEBUG_ASSERT` flag
```scala
nativeCompileOptions += "-DDEBUG_ASSERT"
```
This similar to the way you could enable trace level printing and debug symbols.
```scala
// trace level printing in Immix
nativeCompileOptions += "-DDEBUG_PRINT"
// enable debug symbols for C code
nativeCompileOptions += "-g"
```
- More integrity check asserts for sweeping.
## Refactoring:
- Moved `Block_Sweep` to `Allocator_Sweep` in order to match `LargeAllocator_Sweep`.
- Moved `Heap_AllocSmall` and `HeapAllocLarge` to their respective allocators
- Renamed `block_superblock_middle` to ` block_superblock_tail` in order to avoid confusion. This block flag is used for both middle and last blocks
ekrich pushed a commit to ekrich/scala-native that referenced this pull request May 21, 2021
Features:
- New `SCALANATIVE_GC` option  `commix` to enable the new GC changes.
- Concurrent, parallel sweep. Reduced GC pause times by utilizing additional processor cores during sweeping.
- Parallel mark. Reduces GC pause times by utilizing additional processor cores during marking.
- Configurable number of GC threads with `SCALANATIVE_GC_THREADS` environment variable. Set to number of available processors - 1 up to 8, but no less than 1.
- Increasing heap size until mark is <=5% of total time. This can be adjusted with `SCALANATIVE_TIME_RATIO`. I.e. `export SCALANATIVE_TIME_RATIO=0.03` for <= 3%.
- Added an option the change the minimum free block ratio `SCALANATIVE_FREE_RATIO`. If there are not enough free blocks after a garbage collection it will increase the heap size.
- The minimum heap size setting renamed from `SCALANATIVE_MIN_HEAP_SIZE` to a shorter `SCALANATIVE_MIN_SIZE`. Updated Immix to match.
- The maxium heap size setting renamed from `SCALANATIVE_MAX_HEAP_SIZE` to a shorter `SCALANATIVE_MAX_SIZE`. Updated Immix to match.
### Changes to GC Statistics
- Stat collection disabled by default to reduce code size. They can be enabled by compiler arguments. See example and table below.
- Stats changed to event-based CSV format.
- Stats now also saves events for collection start and end.
- Stats includes `start_ns` column - time in nanoseconds since application was started.
- Stats is compatible with the new concurrent sweep events.
 Multiple verbosity levels of enabled for stats with compiler arguments. For example:
```scala
nativeCompileOptions += "-DENABLE_GC_STATS_BATCHES"
```

> scala-native-benchmarks flags as per suggested changes in scala-native/scala-native-benchmarks#3
> results size for default tests when doing a single run `--runs 1` instead of the default which is 20.

Internals:
- thread-safe `BlockList`s
- thread-safe `BlockRange`s
- thread-safe block counts
- thread-safe `GreyList`s
- new block flags in `BlockMeta`
- removed marking `Stack`s

Debugging :
- asserts in Immix can now be enabled by setting `DEBUG_ASSERT` flag
```scala
nativeCompileOptions += "-DDEBUG_ASSERT"
```
This similar to the way you could enable trace level printing and debug symbols.
```scala
// trace level printing in Immix
nativeCompileOptions += "-DDEBUG_PRINT"
// enable debug symbols for C code
nativeCompileOptions += "-g"
```
- More integrity check asserts for sweeping.
## Refactoring:
- Moved `Block_Sweep` to `Allocator_Sweep` in order to match `LargeAllocator_Sweep`.
- Moved `Heap_AllocSmall` and `HeapAllocLarge` to their respective allocators
- Renamed `block_superblock_middle` to ` block_superblock_tail` in order to avoid confusion. This block flag is used for both middle and last blocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants