Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
That seems quite bad :/ weird.
We have fairly large test projects which do not take anywhere close to it, maybe your code is triggering some bad code path.
Can you provide a sample or share your project with us? It is impossible to do something here unless we have a reproduction case. Might also possibly be related to your machine configuration.
We have fairly large test projects which do not take anywhere close to it, maybe your code is triggering some bad code path.
Can you provide a sample or share your project with us? It is impossible to do something here unless we have a reproduction case. Might also possibly be related to your machine configuration.
jb...@google.com <jb...@google.com> #3
Let me see what I can do on the reproduction as I am anyways blocked on this. I will try to extract out the DB module in a new project and see if it reproduces the issue.
ga...@gmail.com <ga...@gmail.com> #4
Attaching the sample project. When I run the project through the android studio or even command line, I see the described issue.
Try uncommenting room-compiler dependency from app's build.gradle, it does not have the issue because room compiler is not at work.
Try uncommenting room-compiler dependency from app's build.gradle, it does not have the issue because room compiler is not at work.
ap...@google.com <ap...@google.com> #5
Did you get a chance to look at it?
ap...@google.com <ap...@google.com> #6
FYI. I see that if I comment out applying google-services plugin (at the end of the app's build.gradle file), that fixes the issue too. Hence, you may need to apply a google-services plugin with a json file to reproduce the issue.
Not sure what is going on but certainly, somethings are not playing well together.
Not sure what is going on but certainly, somethings are not playing well together.
ap...@google.com <ap...@google.com> #7
Above comment is NOT TRUE, it seems I did not do a code change after commenting out apply google-services plugin. That's why the build passed.
ap...@google.com <ap...@google.com> #8
Thanks for the sample app. I haven't gotten to the bottom of the issue yet but I wanted to give you an update and it does seem indeed that Room is taking a very long time to parse and understand your queries via the ANTLR generated parser that Room uses. I'm not sure what is so special about your queries that is causing this, but I'll comment back with an update once I find out. Sadly for now I don't have a recommendation on a workaround.
ap...@google.com <ap...@google.com> #9
Alright, I've drill down the problem to being the various "OR <col_name> LIKE '%' : text '%'" in your queries. Specifically they cause the SQLiteParser in Room to go down a path with poor performance as described in https://github.com/antlr/antlr4/issues/1398 . A fix for this involves updating Room's ANTRL runtime library and generated parser code with the latest version. This update will likely be available in Room 2.1.0-alpha02.
ap...@google.com <ap...@google.com> #10
Thanks for the update. Is 2.1.0-alpha02 around the corner?
ap...@google.com <ap...@google.com> #11
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 8e46b9ca1f55b040a18dd86833880b5106d103b2
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Oct 10 19:17:50 2018
Update Room's ANTLR Parser to 4.7.1
Updating to the latest ANTLR version fixes the performance issue
described inhttps://github.com/antlr/antlr4/issues/1398 which affects
Room's SQL Parser since it contains left-recursive rules. Specifically
SQLite.g4 has multiple recursions to describe an expression as defined
inhttps://www.sqlite.org/lang_expr.html , meaning if a user has certain
queries that causes the parser to use the adaptivePredict algorithm
then the build time increases significantly due to Room's query
parsing.
Also bumped Room's version to 2.1.0-alpha02
Bug: 117401230
Test: ./gradlew room:integration-tests:testapp:cC
Change-Id: I4d0799a11ccee816ab209cbf74e7dcf2b2ce1a18
M buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
M buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/dao/UserDao.java
https://android-review.googlesource.com/786077
https://goto.google.com/android-sha1/8e46b9ca1f55b040a18dd86833880b5106d103b2
Branch: androidx-master-dev
commit 8e46b9ca1f55b040a18dd86833880b5106d103b2
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Oct 10 19:17:50 2018
Update Room's ANTLR Parser to 4.7.1
Updating to the latest ANTLR version fixes the performance issue
described in
Room's SQL Parser since it contains left-recursive rules. Specifically
SQLite.g4 has multiple recursions to describe an expression as defined
in
queries that causes the parser to use the adaptivePredict algorithm
then the build time increases significantly due to Room's query
parsing.
Also bumped Room's version to 2.1.0-alpha02
Bug: 117401230
Test: ./gradlew room:integration-tests:testapp:cC
Change-Id: I4d0799a11ccee816ab209cbf74e7dcf2b2ce1a18
M buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
M buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
M room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/dao/UserDao.java
ap...@google.com <ap...@google.com> #12
No concrete date on 2.1.0-alpha02, I want to get a few more bugs in before making the next alpha release. So maybe by the end of the month.
ap...@google.com <ap...@google.com> #13
--
- Ankit
- Ankit
ap...@google.com <ap...@google.com> #14
Project: platform/frameworks/support
Branch: snap-temp-L25200000699921867
commit b7b6a6655ccad65b509d1b1e2b6e7c4d69a8f852
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jul 30 18:45:38 2020
override equals and hashCode for NavOptions
Lets implement these methods to simplify comparing NavOptions.
Equals method generated using studio.
Test: ./gradlew bOS
Bug: 161586466
Change-Id: I1beb8d06aa72ed6ad7bfe77d1f134a9793bc7e38
(cherry picked from commit 26288a9e8c3cb7ef4888ed252e2765bda7ab7d54)
M navigation/navigation-common/src/main/java/androidx/navigation/NavOptions.java
https://android-review.googlesource.com/1436922
Branch: snap-temp-L25200000699921867
commit b7b6a6655ccad65b509d1b1e2b6e7c4d69a8f852
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jul 30 18:45:38 2020
override equals and hashCode for NavOptions
Lets implement these methods to simplify comparing NavOptions.
Equals method generated using studio.
Test: ./gradlew bOS
Bug: 161586466
Change-Id: I1beb8d06aa72ed6ad7bfe77d1f134a9793bc7e38
(cherry picked from commit 26288a9e8c3cb7ef4888ed252e2765bda7ab7d54)
M navigation/navigation-common/src/main/java/androidx/navigation/NavOptions.java
ap...@google.com <ap...@google.com> #15
Project: platform/frameworks/support
Branch: snap-temp-L07700000699933785
commit 6e637298fa0127e409ab105309e19cb1869e2c76
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jul 30 18:45:38 2020
override equals and hashCode for NavOptions
Lets implement these methods to simplify comparing NavOptions.
Equals method generated using studio.
Test: ./gradlew bOS
Bug: 161586466
Change-Id: I1beb8d06aa72ed6ad7bfe77d1f134a9793bc7e38
(cherry picked from commit 26288a9e8c3cb7ef4888ed252e2765bda7ab7d54)
M navigation/navigation-common/src/main/java/androidx/navigation/NavOptions.java
https://android-review.googlesource.com/1436927
Branch: snap-temp-L07700000699933785
commit 6e637298fa0127e409ab105309e19cb1869e2c76
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jul 30 18:45:38 2020
override equals and hashCode for NavOptions
Lets implement these methods to simplify comparing NavOptions.
Equals method generated using studio.
Test: ./gradlew bOS
Bug: 161586466
Change-Id: I1beb8d06aa72ed6ad7bfe77d1f134a9793bc7e38
(cherry picked from commit 26288a9e8c3cb7ef4888ed252e2765bda7ab7d54)
M navigation/navigation-common/src/main/java/androidx/navigation/NavOptions.java
Description
Component used: Navigation Version used: 2.3.0
In some of our jvm tests we want to check that the right navigation is triggered. Since we are not on an actual device we are checking if the correct
NavDirections
object andNavOptions
object are passed to the navigator. HoweverNavOptions
currently does not overrideequals
andhashCode
which makes this more complicated than needed. Since allNavOptions
fields are eitherint
orboolean
this should be straightforward to do.