Compile the framework statically#306
Conversation
Testcontainers 1.x is not by default compatible with Docker 29.0.0+ API.
It was unnecessarily re-defining `getTestManager()` from super which made it fail.
|
Hey, @matrei ! Thanks for including the Gradle build scan. I'm curious, is there a comparison scan for how the tests execute without this change? Grails' tests working with it is a good proof that it should generally work, but I'd like to see a comparison build to demonstrate that it makes some meaningful difference. One tricky thing about a sweeping change like this is that it's hard to discern how it might impact downstream consumers. Any thoughts? Feel free to call me out if I'm wrong about the risk. |
Testing dynamic dispatch compatibility when the Geb framework is statically compiled.
8b84a77 to
3637855
Compare
|
Hi @jonnybot0, here are fresh build scans from
and a comparison: https://develocity.apache.org/c/2qxlt7n4azbwq/lmjyrrnzz33sm/task-inputs I filtered to only run the Geb tests instead of running all integration tests to get more meaningful results. On this particular machine and these particular runs: I totally understand that you stress the importance of not introducing breaking changes. I targeted I added a |
|
So, what's the goal of statically compiling, then? Looking at the performance tab, it looks like the build with 8.0.1 ran about 14 seconds slower, but it used about 500 MB less memory at the peak: Performance reports8.0.1 - https://develocity.apache.org/s/2qxlt7n4azbwq/performance/build Test Reports8.0.1 - https://develocity.apache.org/s/2qxlt7n4azbwq/tests/overview For the actual task execution time (not total "serial" time), it was only about 5 seconds different. That could be down to environmental variations. The static compiler is great for when you need it, but what does using it here add? Or, perhaps the more useful question, what's the felt need you're dealing with? Is it a performance need? To be clear, I don't want to block us moving forward, but I do want to make sure we're meeting the heart of the felt need, and I don't think I understand it from context. |
|
The goal was primarily performance. We have seen radically decreased performance for dynamic Groovy in Grails on Groovy 4 and l wanted to see if there were some low hanging fruits for shaving off some time on our test suites. I agree that there is not much gained in this for the current Grails tests, but now we at least know from testing it. Also, on another tangent, I do think Groovy framework code should optimally be compiled statically if possible and reaching for the dynamic nature of Groovy only for scripts and DSLs. If you think it is a bad idea, I have no problem targeting another version or scrapping it all together. |
|
@matrei - I do think considering performance more deeply is a good idea. I'd also agree that Spock has had a Groovy 5 supporting release since December, so it should be pretty doable to work up a version of Geb that can run on Groovy 5. I wouldn't expect to see any performance gains until Groovy 6 (currently in alpha), but again, you never know until you measure. :) That said, I recognize you're volunteering the project & I want to be respectful of your time. If you're keen to have a go at performance, here are things I can think of that might be useful:
Those are both fairly deep dives, though. If you weren't up for that, no worries! We can close this and keep it as a record for someone who wants to chase that down on some future date. |
These changes have been tested on
grails-corefunctional tests:https://develocity.apache.org/s/fs5tgfkrlla7o/tests/overview