@@ -13,8 +13,8 @@ It turns out that the use of Scala's implicits as well as macros can greatly
13
13
increase compilation times, depending on how they are used and how your
14
14
codebase is organized. Codebases that make use of libraries like [ Shapeless] ,
15
15
or which rely on typeclass derivation, may be particularly prone to these
16
- slow-downs. ( As of Scala 2.12, typeclass derivation is based on
17
- implicitly-triggered macro expansions.)
16
+ slow-downs. As of Scala 2.12, typeclass derivation is based on
17
+ implicitly-triggered macro expansions.
18
18
19
19
The goal of this blog post is to help you understand when these things are
20
20
happening in your code, so you can remove code that triggers unnecessary
@@ -194,9 +194,9 @@ Add the compiler flag to the field `options` inside the
194
194
automatically pick up your changes and add the compiler option without the
195
195
need of a ` reload ` .
196
196
197
- ( If you use sbt, add ` scalacOptions in Compile += "-Ystatistics" ` to your
197
+ If you use sbt, add ` scalacOptions in Compile += "-Ystatistics" ` to your
198
198
project settings. If you want to profile tests scope it to ` Test ` instead of
199
- ` Compile ` .)
199
+ ` Compile ` .
200
200
201
201
Run ` bloop compile frontend -w --reporter scalac ` (we use the default scalac
202
202
reporter for clarity) and have a look at the data. The output of the
@@ -300,9 +300,9 @@ dependent types, type projections or abstract types in a more general way.
300
300
In the case of ` frontend ` , the durations of all these operations are
301
301
reasonable, which hints us that the inefficiency is elsewhere.
302
302
303
- ( For most of the cases, these timers are unlikely to be high when typechecking
303
+ For most of the cases, these timers are unlikely to be high when typechecking
304
304
your program. If they are, try to figure out why and file a ticket in
305
- ` scala/bug ` so that either I or the Scala team can look into it.)
305
+ ` scala/bug ` so that either I or the Scala team can look into it.
306
306
307
307
### The troublemaker
308
308
@@ -771,14 +771,14 @@ when finding an implicit for `HListParser` (which takes type parameters
771
771
[inferred from its other functional
772
772
dependencies](https://github.com/alexarchambault/case-app/blob/v1.2.0/core/shared/src/main/scala/caseapp/core/Parser.scala#L77-L84)).
773
773
774
- Let' s further debug this with `-Xlog-implicits` (by adding it to the scalac
775
- options of the bloop configuration file) .
774
+ Let' s further debug this by adding `-Xlog-implicits` to the scalac
775
+ options of the bloop configuration file.
776
776
777
- ( This is a good moment to try to minimize the problem. `-Xlog-implicits` will
777
+ This is a good moment to try to minimize the problem. `-Xlog-implicits` will
778
778
log a lot of failed searches and we want to be able to see through the noise.
779
779
I did minimise the issue
780
780
[here](https://github.com/scalacenter/scalac-profiling/pull/23/commits/dbcb8d480e9b402899d21620055bc555b2841382).
781
- Doing `implicitly[Parser[CliOptions]]` also reproduces it.)
781
+ Doing `implicitly[Parser[CliOptions]]` also reproduces it.
782
782
783
783
Among all the logs, this is the one that attracts my attention the most.
784
784
@@ -1006,12 +1006,12 @@ experienced with the codebase have a look at it. If we're lucky, someone will
1006
1006
fix this issue upstream soon and we' ll benefit from this speed up when we
1007
1007
upgrade.
1008
1008
1009
- ( After discussing this issue with [Miles](https://github.com/milessabin/) we
1009
+ After discussing this issue with [Miles](https://github.com/milessabin/) we
1010
1010
both agree the strict/lazy macro is not handling refinement types correctly
1011
1011
and that this performance penalty is a bug. This bug will most likely be fixed
1012
1012
in a future version of Shapeless after 2.3.3 for all its users. Some of these
1013
1013
performance implications will be gone with Scala 2.13, that adds by-name
1014
- implicits to the compiler.)
1014
+ implicits to the compiler.
1015
1015
1016
1016
# ### Deduplicating more expansions
1017
1017
0 commit comments