Comments (12)
This is a minimal reproduction of the issue without skunk or external dependencies, courtesy of @jdrphillips
https://gist.github.com/jdrphillips/5dc1f533e8d44f9b34962c79798d8839
from skunk.
Reproduced on proprietary codebase with a non-contrived example. Getting times in the same magnitude as cited on that repro readme.
from skunk.
It would be great if someone could investigate and see what's going on. There's no inductive implicit resolution happening so I don't have a good starting guess.
from skunk.
Compiled with scalac profiling, you can obtain the results here
https://github.com/dimitarg/skunk-test/blob/main/trace.trace
(this file is openable e.g. via a chromium browser if you type chrome://tracing/
in the address bar)
If I am reading this right, all the time is spent in patmat
and not in the typer @tpolecat ?
from skunk.
P.S. my fork of the repro repo must be compiled with jdk 8
. I had trouble using jdk 11 on this - the compiler with tracing turned on crashes due to an error to do with the Java Module System.
from skunk.
I added -Ystatistics:patmat
to the repro compiler settings. Here are the results.
2021.11.09 10:43:21 INFO *** Cumulative statistics at phase patmat
2021.11.09 10:43:21 INFO #class symbols : 6025
2021.11.09 10:43:21 INFO #created scopes : 269
2021.11.09 10:43:21 INFO time spent in patmat : 1 spans, ()85529.34ms
2021.11.09 10:43:21 INFO of which DPLL : 0 spans, ()0.0ms (0.0%)
2021.11.09 10:43:21 INFO of which in CNF conversion : 0 spans, ()0.0ms (0.0%)
2021.11.09 10:43:21 INFO of which variable equality : 2 spans, ()42949.729ms (50.2%)
2021.11.09 10:43:21 INFO of which in exhaustivity : 0 spans, ()0.0ms (0.0%)
2021.11.09 10:43:21 INFO of which in unreachability : 1 spans, ()64122.824ms (75.0%)
2021.11.09 10:43:21 INFO time spent in scope population: 107 spans, ()0.278ms
2021.11.09 10:43:21 INFO #base type seqs : 3260
2021.11.09 10:43:21 INFO avg base type seq length : 7.2
2021.11.09 10:43:21 INFO of which for compound types : 1344 (41.2%)
2021.11.09 10:43:21 INFO of which for typerefs : 1915 (58.7%)
2021.11.09 10:43:21 INFO #type symbols : 6977
2021.11.09 10:43:21 INFO #unique types : 7624
2021.11.09 10:43:21 INFO #typechecked identifiers : 202
2021.11.09 10:43:21 INFO #typechecked selections : 1510
2021.11.09 10:43:21 INFO #created tree nodes : 3534
2021.11.09 10:43:21 INFO #findMember ops : 3185
2021.11.09 10:43:21 INFO of which not found : 855 (26.8%)
2021.11.09 10:43:21 INFO of which multiple overloaded: 24 (0.8%)
2021.11.09 10:43:21 INFO #subtype ops : 6875
2021.11.09 10:43:21 INFO #symbols : 11999
2021.11.09 10:43:21 INFO #sametype ops : 268433982
2021.11.09 10:43:21 INFO #all lubs/glbs : 433
2021.11.09 10:43:21 INFO #typechecked applications : 149
2021.11.09 10:43:21 INFO *** Cumulative timers for phases
2021.11.09 10:43:21 INFO #total compile time : 1 spans, ()86203.234ms
2021.11.09 10:43:21 INFO parser : 1 spans, ()1.915ms (0.0%)
2021.11.09 10:43:21 INFO bm4-parser : 1 spans, ()8.285ms (0.0%)
2021.11.09 10:43:21 INFO bm4-parser2 : 1 spans, ()2.345ms (0.0%)
2021.11.09 10:43:21 INFO kind-projector : 1 spans, ()2.963ms (0.0%)
2021.11.09 10:43:21 INFO namer : 1 spans, ()0.86ms (0.0%)
2021.11.09 10:43:21 INFO packageobjects : 1 spans, ()0.158ms (0.0%)
2021.11.09 10:43:21 INFO typer : 1 spans, ()86.068ms (0.1%)
2021.11.09 10:43:21 INFO semanticdb-typer : 1 spans, ()446.553ms (0.5%)
2021.11.09 10:43:21 INFO bm4-typer : 1 spans, ()5.554ms (0.0%)
2021.11.09 10:43:21 INFO superaccessors : 1 spans, ()0.613ms (0.0%)
2021.11.09 10:43:21 INFO extmethods : 1 spans, ()0.229ms (0.0%)
2021.11.09 10:43:21 INFO pickler : 1 spans, ()0.237ms (0.0%)
2021.11.09 10:43:21 INFO picklergen : 1 spans, ()0.04ms (0.0%)
2021.11.09 10:43:21 INFO xsbt-api : 1 spans, ()8.393ms (0.0%)
2021.11.09 10:43:21 INFO xsbt-dependency : 1 spans, ()2.781ms (0.0%)
2021.11.09 10:43:21 INFO refchecks : 1 spans, ()1.857ms (0.0%)
2021.11.09 10:43:21 INFO patmat : 1 spans, ()85536.66ms (99.2%)
2021.11.09 10:43:21 INFO uncurry : 1 spans, ()4.964ms (0.0%)
2021.11.09 10:43:21 INFO fields : 1 spans, ()0.559ms (0.0%)
2021.11.09 10:43:21 INFO tailcalls : 1 spans, ()0.931ms (0.0%)
2021.11.09 10:43:21 INFO specialize : 1 spans, ()39.97ms (0.0%)
2021.11.09 10:43:21 INFO explicitouter : 1 spans, ()1.091ms (0.0%)
2021.11.09 10:43:21 INFO erasure : 1 spans, ()16.313ms (0.0%)
2021.11.09 10:43:21 INFO posterasure : 1 spans, ()0.48ms (0.0%)
2021.11.09 10:43:21 INFO lambdalift : 1 spans, ()0.905ms (0.0%)
2021.11.09 10:43:21 INFO constructors : 1 spans, ()0.303ms (0.0%)
2021.11.09 10:43:21 INFO flatten : 1 spans, ()1.118ms (0.0%)
2021.11.09 10:43:21 INFO mixin : 1 spans, ()0.392ms (0.0%)
2021.11.09 10:43:21 INFO cleanup : 1 spans, ()0.356ms (0.0%)
2021.11.09 10:43:21 INFO delambdafy : 1 spans, ()1.393ms (0.0%)
2021.11.09 10:43:21 INFO jvm : 1 spans, ()9.93ms (0.0%)
2021.11.09 10:43:21 INFO semanticdb-jvm : 1 spans, ()0.498ms (0.0%)
2021.11.09 10:43:21 INFO xsbt-analyzer : 1 spans, ()0.307ms (0.0%)
2021.11.09 10:43:21 INFO time: compiled root in 1m26s
from skunk.
This diff exhibits the same pathology. So maybe at least we can rule out tilde unapply
as the villain.
from skunk.
This compiles instantaneously, proving that indeed the pattern match is where scalac spends its time.
from skunk.
This appears to be a viable workaround
from skunk.
This is also tracked via scala/bug#12489
from skunk.
scala/bug#12489 is now targeted for 2.13.9 , but that is getting delayed as per https://contributors.scala-lang.org/t/scala-2-13-9-release-planning/5693/2
(keeping a centralised log here because this issue is important for us. Let me know if this is spamming / not helping other people and I'll stop)
from skunk.
This is still reproducible. I believe scala/bug#12489 landed in 2.13.10 but that doesn't cut it. Perhaps scala/bug#12527 is what tracks the underlying issue now (I don't have a deep enough understanding).
I don't reproduce this problem with 0.6.0-RC2
on Scala 2.13.10, which uses HList
.
from skunk.
Related Issues (20)
- Type inference for type argument in `to[A]` no longer working HOT 1
- Deadlock while using session pool HOT 1
- Unhandled backend message HOT 1
- NumberFormatException when parsing OID values exceeding 32-bit signed integer range HOT 5
- e HOT 1
- SSLTest index out of bounds
- Aggregate function on empty table produces exception when executing with option HOT 2
- Cannot configure Recycler on connection pool
- Ambiguous overload for 0.6.0 Twiddle lists HOT 3
- Skunk sends all arguments to tracing/logging HOT 6
- Fragment's stripMargin can change the query
- Exceptions in transactions are printed to stderr HOT 3
- Skunk can't find `enum` type in schema HOT 3
- Support query pipelineing in a single session HOT 1
- Relax reliance on `SocketGroup` HOT 1
- Feature reqest: migrations. HOT 1
- Extending the sql interpolator?
- Session pool examples [Question]
- decode joined rows
- Fragment interpolation breaks with nested fragments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skunk.