Comments (7)
I can second this complaint. We have invested quite a lot of time to migrate from Doobie to pure Quill queries and now the compilation times are really slow. It feels like for some reason the work is done in sequence in a single thread instead of in parallel, but I don't know quite why.
Any kind of suggestion how to speed up the compilation time will be highly appreciated.
Or at least some explanation why is there such slowdown...
from zio-quill.
Thanks for the pointer @guizmaii , however the compilation time did not improve significantly and I started getting runtime errors from Quill 😬 , so this solution did not work in my case. It might be due to the fact that we use quill-doobie and not a pure quill implementation 🤷
from zio-quill.
Add implicit QueryMeta
instance should not affect runtime behavior, it only affect compile time implicit resolution.
Also there's
-Yprofile-trace FILE
in scalac, this can help find the slow part of compilation.
from zio-quill.
FYI @lachezar, I discovered this PR documenting a tip to speed up compilation time: #2532
Can you give it a try maybe?
from zio-quill.
Thanks for the suggestions, @jilen
When trying to run with -Yprofile-trace
I get java.lang.ExceptionInInitializerError
and a very long stack trace. I use Java 11.0.19
and sbt 1.8.3
and scala 2.13.10
.
Regarding the runtime error: I've detected the error when running the unit/integration tests of the project and it is due to java.lang.NoSuchMethodError
Error sample:
java.lang.NoSuchMethodError: 'java.lang.Object <redacted>.repositories.OfferRepositoryQueries$.$anonfun$offerQueryMeta$1$adapted(java.lang.String)'
at <redacted>.repositories.OfferRepositoryQueries$$anon$1.$anonfun$extract$1(OfferRepository.scala:451) ~[classes/:na]
at io.getquill.doobie.DoobieContextBase.$anonfun$extractorToRead$1(DoobieContextBase.scala:210) ~[quill-doobie_2.13-4.4.1.jar:4.4.1]
at io.getquill.doobie.DoobieContextBase.$anonfun$extractorToRead$1$adapted(DoobieContextBase.scala:210) ~[quill-doobie_2.13-4.4.1.jar:4.4.1]
at doobie.hi.resultset$.$anonfun$build$1(resultset.scala:90) ~[doobie-core_2.13-1.0.0-RC2.jar:1.0.0-RC2]
at doobie.free.KleisliInterpreter.$anonfun$primitive$2(kleisliinterpreter.scala:113) ~[doobie-free_2.13-1.0.0-RC2.jar:1.0.0-RC2]
at zio.ZIOCompanionVersionSpecific.$anonfun$attempt$1(ZIOCompanionVersionSpecific.scala:100) ~[zio_2.13-2.0.6.jar:2.0.6]
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:1111) ~[zio_2.13-2.0.6.jar:2.0.6]
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:1068) ~[zio_2.13-2.0.6.jar:2.0.6]
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:1011) ~[zio_2.13-2.0.6.jar:2.0.6]
at zio.internal.FiberRuntime.runLoop(FiberRuntime.scala:934) ~[zio_2.13-2.0.6.jar:2.0.6]
at zio.internal.FiberRuntime.evaluateEffect(FiberRuntime.scala:389) ~[zio_2.13-2.0.6.jar:2.0.6]
at zio.internal.FiberRuntime.evaluateMessageWhileSuspended(FiberRuntime.scala:512) ~[zio_2.13-2.0.6.jar:2.0.6]
at zio.internal.FiberRuntime.drainQueueOnCurrentThread(FiberRuntime.scala:229) ~[zio_2.13-2.0.6.jar:2.0.6]
at zio.internal.FiberRuntime.run(FiberRuntime.scala:138) ~[zio_2.13-2.0.6.jar:2.0.6]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
If I remove the manual creation of the QueryMeta instance and rely on the macro, then everything works normally.
from zio-quill.
@lachezar You may need things like --add-exports
or add-open
, the full stacktrace should show the java9+ module errors.
Or just try java8 instead.
from zio-quill.
@jilen I ran the compilation of my "db" sbt module (containing all my Quill code) with the -Yprofile-trace
flag.
What takes the most time to compile are my tests, which are containing a lot of queries (aka ctx.run(myQuery)
), and apparently especially one file, TestUtils.scala
, which contains all the instances of my case classes representing my DB data (Org_A
, Org_B
, User_0
, etc. are case classes instances) is taking the most time to compile with two "apply" calls. Not sure to understand why there are 2 "apply" calls 🤔
from zio-quill.
Related Issues (20)
- create ilike query in postgres via quill-jdbc HOT 3
- Slow build times with Quill, can our approach be improved? HOT 7
- The Link to contributing guid is not working HOT 1
- Broken reference to Contributing guideline HOT 2
- "Found more then one type of Query" Warning
- Question about migration to Quill HOT 2
- [Question to the community] Removing `jasync` modules? HOT 7
- SQL syntax when call delete method HOT 4
- io.getquill.context.jdbc.Decoders#dateDecoder creates java.util.Calendar for every request HOT 1
- SQL Query Generation Error: Unquoted Keywords Causes Statement Errors with Postgres
- Error with Batch Update HOT 4
- Compilation Error When Filtering on Aggregation Functions HOT 1
- `Query.update(T => (Any, Any), (T => (Any, Any))*)` does not support `Seq()*` style notation.
- Contributor's Guide page not found HOT 1
- Doobie LogHandler dont work with a quill
- Batch upsert leads to run-time crash HOT 1
- Pgvector can be written but can't be read HOT 1
- Exception in Postgres inserting None value for Option[JsonValue[...]] or Option[JsonbValue[...]] fields
- `Force index` doesn't work with infix query
- [Feature request] Allow re-use of case class for many table names (during compile)
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 zio-quill.