softdevteam / yksom

Other
8 stars 6 forks source link

Implement NoFinalize for optimisable types #213

Closed jacob-hughes closed 2 years ago

jacob-hughes commented 2 years ago

This gives us a nice performance boost on types which use Drop for allocation only.

----------------------------------------------------------------------------------------------------
  Benchmark     Executor   Suite   Extra   Core   Size   Var   #Samples   Mean (ms)
----------------------------------------------------------------------------------------------------

  Bounce        flzr_opt   micro       2      1                     100          24
  Bounce        baseline   micro       2      1                     100          77
  BubbleSort    flzr_opt   micro       3      1                     100          22
  BubbleSort    baseline   micro       3      1                     100          67
  DeltaBlue     flzr_opt   macro      50      1                      10          15
  DeltaBlue     baseline   macro      50      1                      10          65
  Dispatch      flzr_opt   micro       2      1                     100          13
  Dispatch      baseline   micro       2      1                     100          42
  Fannkuch      flzr_opt   micro       6      1                     100          11
  Fannkuch      baseline   micro       6      1                     100          43
  Fibonacci     flzr_opt   micro       3      1                     100          37
  Fibonacci     baseline   micro       3      1                     100         178
  FieldLoop     flzr_opt   micro       1      1                     100          20
  FieldLoop     baseline   micro       1      1                     100          32
  GraphSearch   flzr_opt   macro       4      1                      10           9
  GraphSearch   baseline   macro       4      1                      10          20
  IntegerLoop   flzr_opt   micro       2      1                     100          24
  IntegerLoop   baseline   micro       2      1                     100          76
  JsonSmall     flzr_opt   macro       1      1                      10          34
  JsonSmall     baseline   macro       1      1                      10         101
  List          flzr_opt   micro       2      1                     100          23
  List          baseline   micro       2      1                     100          83
  Loop          flzr_opt   micro       5      1                     100          33
  Loop          baseline   micro       5      1                     100         121
  Mandelbrot    flzr_opt   micro      30      1                     100         128
  Mandelbrot    baseline   micro      30      1                     100         187
  NBody         flzr_opt   macro     500      1                      10          74
  NBody         baseline   macro     500      1                      10          89
  PageRank      flzr_opt   macro      40      1                      10          45
  PageRank      baseline   macro      40      1                      10         101
  Permute       flzr_opt   micro       3      1                     100          23
  Permute       baseline   micro       3      1                     100          70
  Queens        flzr_opt   micro       2      1                     100          23
  Queens        baseline   micro       2      1                     100          70
  QuickSort     flzr_opt   micro       1      1                     100           7
  QuickSort     baseline   micro       1      1                     100          24
  Recurse       flzr_opt   micro       3      1                     100          21
  Recurse       baseline   micro       3      1                     100          66
  Richards      flzr_opt   macro       1      1                      10         373
  Richards      baseline   macro       1      1                      10        1374
  Sieve         flzr_opt   micro       4      1                     100          31
  Sieve         baseline   micro       4      1                     100         108
  Storage       flzr_opt   micro       1      1                     100           8
  Storage       baseline   micro       1      1                     100          48
  Sum           flzr_opt   micro       2      1                     100          12
  Sum           baseline   micro       2      1                     100          43
  Towers        flzr_opt   micro       2      1                     100          26
  Towers        baseline   micro       2      1                     100          85
  TreeSort      flzr_opt   micro       1      1                     100          15
  TreeSort      baseline   micro       1      1                     100          66
  WhileLoop     flzr_opt   micro      10      1                     100          29
  WhileLoop     baseline   micro      10      1                     100          99
ltratt commented 2 years ago

Let's just quickly check that doing so doesn't change any performance numbers (you should be able to tell from 1 or 2 benchmarks). If it still looks good, please squash.

ltratt commented 2 years ago

OK, pretend I wrote my earlier comment now :)

jacob-hughes commented 2 years ago

It still looks good. Squashed!

ltratt commented 2 years ago

bors r+

bors[bot] commented 2 years ago

Build failed:

jacob-hughes commented 2 years ago

bors try

bors[bot] commented 2 years ago

try

Build failed:

jacob-hughes commented 2 years ago

bors try

bors[bot] commented 2 years ago

try

Build failed:

jacob-hughes commented 2 years ago

bors try

bors[bot] commented 2 years ago

try

Build failed:

jacob-hughes commented 2 years ago

This one runs a SOM test suite as part of CI which I forgot about and didn't run locally. It seems to unearthed a memory corruption in the String implementation which I am investigating.

jacob-hughes commented 2 years ago

bors try

bors[bot] commented 2 years ago

try

Build succeeded:

jacob-hughes commented 2 years ago

This one is ready to squash now.

ltratt commented 2 years ago

Please squash.

jacob-hughes commented 2 years ago

Squashed

ltratt commented 2 years ago

bors r+

bors[bot] commented 2 years ago

Build succeeded:

smarr commented 2 years ago

You may want to consider to run the tests on top of SomSom (SOM implemented in SOM) in addition to how you're running them now.

Might be better at triggering GC-related issues than a normal test run:

/som -G -cp core-lib/Smalltalk:core-lib/TestSuite:core-lib/SomSom/src/compiler:core-lib/SomSom/src/vm:core-lib/SomSom/src/vmobjects:core-lib/SomSom/src/interpreter:core-lib/SomSom/src/primitives \
  core-lib/SomSom/tests/SomSomTests.som

The core lib also got a few more tests in general since the last update, but those are less likely to be of much use.

jacob-hughes commented 2 years ago

Thanks @smarr. I'll add this to the CI.

ltratt commented 2 years ago

@smarr I think we're doing that at https://github.com/softdevteam/yksom/blob/master/.buildbot.sh#L37 ? But it's so long since I've looked at this that I might be completely wrong!

smarr commented 2 years ago

Oh, you're right. I didn't realize that the stdio was just the last view lines. I should have from the line numbers, I guess my brain just filtered those out.

ltratt commented 2 years ago

Hehe no problem :)