Skip to content

Commit 634e541

Browse files
committed
Fix code style. Add comment on benchmark running time
1 parent d09896b commit 634e541

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sips/pending/_posts/2013-05-31-improved-lazy-val-initialization.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ In order to maintain current Scala semantics, we need to correctly handle failin
350350
val result =
351351
try {<RHS>} catch {
352352
case x: Throwable =>
353-
complete(0);
354-
throw x
353+
complete(0);
354+
throw x
355355
}
356356
value_0 = result
357357

@@ -653,7 +653,8 @@ The proposed solution with (V6) is 50% faster than the current lazy val implemen
653653

654654
The local lazy vals implementation is around 6x faster than the current version, as it eliminates the need for boxing and reduces number of allocations from 2 down to 1.
655655

656-
The concrete microbenchmark code is available as a GitHub repo \[[6][6]\]. It additionally benchmarks many other implementations that are not covered in the text of this SIP, in particular it tests versions based on MethodHandles and runtime code generation and versions that use additional spinning before synchronizing on the monitor.
656+
The concrete microbenchmark code is available as a GitHub repo \[[6][6]\]. It additionally benchmarks many other implementations that are not covered in the text of this SIP, in particular it tests versions based on MethodHandles and runtime code generation and versions that use additional spinning before synchronizing on the monitor.
657+
For those wishing to reproduce result, the benchmarking suite takes 90 minutes to run on contemporary CPUs. Enabling all the disabled benchmarks, in particular those that evaluate invokeDynamic based implementation will make the benchmarks take around 5 hours.
657658

658659
### Code size ###
659660
The versions presented in V2-V6 have a lot more complex implementations and this shows up on the bytecode size. In the worst-case scenario, when the `<RHS>` value is a constant, the current scheme (V1) creates an initializer method that has size of 34 bytes, while dotty creates a version that is 184 bytes long. Local optimizations present in dotty linker[14] are able to reduce this size down to 160 bytes, but this is still substantially more than the current version.

0 commit comments

Comments
 (0)