-
Notifications
You must be signed in to change notification settings - Fork 154
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
Reduce compilation times #328
Comments
fthomas
added a commit
that referenced
this issue
Sep 25, 2017
This specializes the macro implementations for `autoRefineV` and `autoRefineT`. Both methods were defined in terms of the generic `RefineMacro.impl` which works for any `RefType[F]`. This generic implementation has the drawback that it needs to `eval` the implicit `RefType` parameter at compile-time. Since `autoRefine{V,T}` already know which `RefType` instance they will use, it is unnecessary to `eval` them in the macro. Here are the benchmark results for master and this change: ``` master: [info] Result "eu.timepit.refined.benchmark.RefineMacroBenchmark.autoRefineV_PosInt": [info] 0.549 ±(99.9%) 0.004 s/op [Average] [info] (min, avg, max) = (0.520, 0.549, 0.593), stdev = 0.015 [info] CI (99.9%): [0.546, 0.553] (assumes normal distribution) [info] # Run complete. Total time: 00:17:45 [info] Benchmark Mode Cnt Score Error Units [info] RefineMacroBenchmark.autoRefineV_PosInt avgt 200 0.549 ± 0.004 s/op impl_Refined: [info] Result "eu.timepit.refined.benchmark.RefineMacroBenchmark.autoRefineV_PosInt": [info] 0.403 ±(99.9%) 0.004 s/op [Average] [info] (min, avg, max) = (0.377, 0.403, 0.471), stdev = 0.017 [info] CI (99.9%): [0.399, 0.407] (assumes normal distribution) [info] # Run complete. Total time: 00:09:07 [info] Benchmark Mode Cnt Score Error Units [info] RefineMacroBenchmark.autoRefineV_PosInt avgt 200 0.403 ± 0.004 s/op ``` That is a decrease in compilation time of ~26%. This is first PR towards reduced compilation times: #328
fthomas
added a commit
that referenced
this issue
Sep 25, 2017
This specializes the macro implementations for `autoRefineV` and `autoRefineT`. Both methods were defined in terms of the generic `RefineMacro.impl` which works for any `RefType[F]`. This generic implementation has the drawback that it needs to `eval` the implicit `RefType` parameter at compile-time. Since `autoRefine{V,T}` already know which `RefType` instance they will use, it is unnecessary to `eval` them in the macro. Here are the benchmark results for master and this change: ``` master: [info] Result "eu.timepit.refined.benchmark.RefineMacroBenchmark.autoRefineV_PosInt": [info] 0.549 ±(99.9%) 0.004 s/op [Average] [info] (min, avg, max) = (0.520, 0.549, 0.593), stdev = 0.015 [info] CI (99.9%): [0.546, 0.553] (assumes normal distribution) [info] # Run complete. Total time: 00:17:45 [info] Benchmark Mode Cnt Score Error Units [info] RefineMacroBenchmark.autoRefineV_PosInt avgt 200 0.549 ± 0.004 s/op impl_Refined: [info] Result "eu.timepit.refined.benchmark.RefineMacroBenchmark.autoRefineV_PosInt": [info] 0.403 ±(99.9%) 0.004 s/op [Average] [info] (min, avg, max) = (0.377, 0.403, 0.471), stdev = 0.017 [info] CI (99.9%): [0.399, 0.407] (assumes normal distribution) [info] # Run complete. Total time: 00:09:07 [info] Benchmark Mode Cnt Score Error Units [info] RefineMacroBenchmark.autoRefineV_PosInt avgt 200 0.403 ± 0.004 s/op ``` That is a decrease in compilation time of ~26%. This is first PR towards reduced compilation times: #328
The first step towards this goal has been merged: ~26% reduced compilation times with #332. |
Reduced compilation time when refining with full refined types: #388 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This tweet https://twitter.com/missingfaktor/status/909064863917510656 shows that increased compilation time with refined is a major issue. We should investigate ways to get better in this regard.
The text was updated successfully, but these errors were encountered: