4

The documentation of Grails 4 mentions an improvement in performance and starting time due to the micronaut parent context ( here ).

Did anyone measure the improvement from Grails 3 to Grails 4? How does Grails 4 compare to Grails 3 in boot time, performance and memory consumption?

Heschoon
  • 2,915
  • 9
  • 26
  • 55
  • I asked a similar question "Should I consider Grails 4 over Micronaut?" Sadly it got downvoted, and eventually removed. I can only guide you rather than answer, I have used Grails 2 & 3, Springboot and from my observations that they don't come any close to Micronaut, so it's very possible that the performance gains will be substantial for Grails 4. – Aditya T May 18 '19 at 13:55
  • An interesting question, the answer to which will definitely influence whether I attempt an upgrade sooner than later. Now it's released have you done any performance comparison ? – David Brown Jul 18 '19 at 08:55
  • Still not, but I've head the framework gained at least fifteen seconds of startup time. – Heschoon Jul 18 '19 at 09:09
  • 4
    My experience so far, with an app that took ~60 seconds to startup, now takes ~30. Hot Reloading while developing has gone in favour of hot restarts, which is somewhat of a drag as if you have anything considerable going on during bootstrapping this can quickly become time-consuming. Although there are workarounds to use spring loaded directly which helps overcome this. When running (in dev mode), this app is noticeably faster, small apps that take < 10 seconds to start up aren't really an issue with hot-restarting, Summary: I'm happy upgrading and will upgrade all my apps to G4 – David Brown Aug 16 '19 at 20:52

2 Answers2

1

Writing an answer for the record. I recently upgraded a fairly sizeable grails 3 app (~150 domain classes) and noticed around 30% reduction in the boot time and 20-30% reduction in the memory footprint of the app. Hot restarting in Grails 4 is really annoying and wastes a lot of time for even small changes. I really miss the hot-swapping of grails 3. Other than that, it's worthwhile.

This article gives some of the grails performance metrics comparison between grails 3.3.9 and 4.0.

Saqib Ahmed
  • 1,056
  • 14
  • 33
0

Just after upgrade from 3.3.14 to 4.0.12 I see 20% more CPU usage and request processing time on production. Can be some non-optimal settings. But with simple framework upgrade I got a performance penalty (150k unique visitors per day, 6Gb of memory).

In same time application use 30% less memory.

UPDATE:

performance issue caused by broken hibernate second level cache for classes with inheritance https://github.com/grails/grails-data-mapping/issues/1594

UPDATE 1:

After fix of cache issue I see CPU usage improvement. Grails4 use around 5-10% less CPU compare to grails 3.3.14

I think, upgrade to grails 4 recommended

demon101
  • 544
  • 1
  • 11
  • 39