Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BDWGC's buffered finalisation #117

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

jacob-hughes
Copy link
Collaborator

This commit switches the new buffered finalisation mechanism in BDWGC using the disclaim API. Gc objects which need finalising are allocated with a 'disclaim' (i.e. finaliser) function pointer in their first word.

These finalisers are added to buffers during GC which are then finalised on a separate thread from within the BDWGC. The table below shows the performance difference between this approach (called disclaim) and the previous tip-of-tree commit (which used the much slower, channel-based off-thread finalisation).

 Benchmark      Config     Type      mean (ms)

  Bounce        baseline   micro     874
  Bounce        disclaim   micro     114
  BubbleSort    baseline   micro     1273
  BubbleSort    disclaim   micro     144
  DeltaBlue     baseline   macro     552
  DeltaBlue     disclaim   macro     91
  Dispatch      baseline   micro     726
  Dispatch      disclaim   micro     120
  Fannkuch      baseline   micro     364
  Fannkuch      disclaim   micro     66
  Fibonacci     baseline   micro     1559
  Fibonacci     disclaim   micro     200
  FieldLoop     baseline   micro     835
  FieldLoop     disclaim   micro     179
  GraphSearch   baseline   macro     175
  GraphSearch   disclaim   macro     43
  IntegerLoop   baseline   micro     1685
  IntegerLoop   disclaim   micro     181
  JsonSmall     baseline   macro     542
  JsonSmall     disclaim   macro     125
  List          baseline   micro     1447
  List          disclaim   micro     149
  Loop          baseline   micro     2099
  Loop          disclaim   micro     231
  Mandelbrot    baseline   micro     1172
  Mandelbrot    disclaim   micro     160
  NBody         baseline   macro     722
  NBody         disclaim   macro     69
  PageRank      baseline   macro     662
  PageRank      disclaim   macro     150
  Permute       baseline   micro     1281
  Permute       disclaim   micro     156
  Queens        baseline   micro     1017
  Queens        disclaim   micro     131
  QuickSort     baseline   micro     251
  QuickSort     disclaim   micro     41
  Recurse       baseline   micro     1313
  Recurse       disclaim   micro     183
  Richards      baseline   macro     Failed
  Richards      disclaim   macro     1722
  Sieve         baseline   micro     1068
  Sieve         disclaim   micro     215
  Storage       baseline   micro     79
  Storage       disclaim   micro     43
  Sum           baseline   micro     864
  Sum           disclaim   micro     105
  Towers        baseline   micro     1309
  Towers        disclaim   micro     153
  TreeSort      baseline   micro     350
  TreeSort      disclaim   micro     66
  WhileLoop     baseline   micro     1962
  WhileLoop     disclaim   micro     262

@ltratt ltratt added this pull request to the merge queue Apr 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 17, 2024
@jacob-hughes
Copy link
Collaborator Author

Fixed here: 73ecbeb (No need to squash)

@ltratt ltratt added this pull request to the merge queue Apr 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 17, 2024
@jacob-hughes
Copy link
Collaborator Author

This one is an issue with yksom. I'm looking into a fix for this now.

@jacob-hughes
Copy link
Collaborator Author

Fixed here: 1a8fe88

@ltratt
Copy link
Member

ltratt commented Apr 18, 2024

Please squash.

@jacob-hughes
Copy link
Collaborator Author

Squashed

@ltratt ltratt added this pull request to the merge queue Apr 18, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 18, 2024
@jacob-hughes
Copy link
Collaborator Author

That'll teach me from re-typing a one line fix from bencher16 rather than applying the patch commit: b7566a0

@ltratt
Copy link
Member

ltratt commented Apr 18, 2024

Please squash.

This commit switches the new buffered finalisation mechanism in BDWGC
using the disclaim API. Gc<T> objects which need finalising are
allocated with a 'disclaim' (i.e. finaliser) function pointer in their
first word.

These finalisers are added to buffers during GC which are then finalised
on a separate thread from within the BDWGC. The table below shows the
performance difference between this approach (called disclaim) and the
previous tip-of-tree commit (which used the much slower, channel-based
off-thread finalisation).

```
 Benchmark      Config     Type      mean (ms)

  Bounce        baseline   micro     874
  Bounce        disclaim   micro     114
  BubbleSort    baseline   micro     1273
  BubbleSort    disclaim   micro     144
  DeltaBlue     baseline   macro     552
  DeltaBlue     disclaim   macro     91
  Dispatch      baseline   micro     726
  Dispatch      disclaim   micro     120
  Fannkuch      baseline   micro     364
  Fannkuch      disclaim   micro     66
  Fibonacci     baseline   micro     1559
  Fibonacci     disclaim   micro     200
  FieldLoop     baseline   micro     835
  FieldLoop     disclaim   micro     179
  GraphSearch   baseline   macro     175
  GraphSearch   disclaim   macro     43
  IntegerLoop   baseline   micro     1685
  IntegerLoop   disclaim   micro     181
  JsonSmall     baseline   macro     542
  JsonSmall     disclaim   macro     125
  List          baseline   micro     1447
  List          disclaim   micro     149
  Loop          baseline   micro     2099
  Loop          disclaim   micro     231
  Mandelbrot    baseline   micro     1172
  Mandelbrot    disclaim   micro     160
  NBody         baseline   macro     722
  NBody         disclaim   macro     69
  PageRank      baseline   macro     662
  PageRank      disclaim   macro     150
  Permute       baseline   micro     1281
  Permute       disclaim   micro     156
  Queens        baseline   micro     1017
  Queens        disclaim   micro     131
  QuickSort     baseline   micro     251
  QuickSort     disclaim   micro     41
  Recurse       baseline   micro     1313
  Recurse       disclaim   micro     183
  Richards      baseline   macro     Failed
  Richards      disclaim   macro     1722
  Sieve         baseline   micro     1068
  Sieve         disclaim   micro     215
  Storage       baseline   micro     79
  Storage       disclaim   micro     43
  Sum           baseline   micro     864
  Sum           disclaim   micro     105
  Towers        baseline   micro     1309
  Towers        disclaim   micro     153
  TreeSort      baseline   micro     350
  TreeSort      disclaim   micro     66
  WhileLoop     baseline   micro     1962
  WhileLoop     disclaim   micro     262
```
@jacob-hughes
Copy link
Collaborator Author

Squashed

@ltratt ltratt added this pull request to the merge queue Apr 18, 2024
Merged via the queue into softdevteam:master with commit dbed28e Apr 18, 2024
2 checks passed
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