Grails performance issue

65 views
Skip to first unread message

Andrey Z.

unread,
Dec 27, 2016, 1:58:50 AM12/27/16
to Grails Dev Discuss

Hello.


During request processing i need to load a lot of entities (of two kinds). Maybe 4 or 5 thousands. Most of them are served from 2nd-level cache. The problem is dependency injection which is applied to every domain class killing application performance.


Profiler shows bottleneck is org.codehaus.groovy.grails.plugins.web.api.ControllersDomainBindingApi.autowire which calls GrailsMetaClassUtils.invokeMethodIfExists.


I tried to load entities from Controller and from Service classes. Results are the same.


Is it possible to disable this unnecessary DI feature for particular case or class?


My Grails version is 2.3.11.

Java 1.8

Jeff Brown

unread,
Dec 28, 2016, 9:38:22 PM12/28/16
to grails-de...@googlegroups.com
On December 27, 2016 at 12:59:00 AM, Andrey Z. (zhuch...@gmail.com) wrote:
>
>
>
>
> Is it possible to disable this unnecessary *DI* feature for particular case
> or class?
>
>

No, but I think that is a reasonable feature to request.




JSB

--
Jeff Scott Brown
OCI Grails Practice Lead
Principal Software Engineer

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

oru...@beapi.io

unread,
Dec 29, 2016, 11:53:18 AM12/29/16
to Grails Dev Discuss

The ControllersDomainBindingApi.autowire binds the domain of the same name to the controller of the same name (from what I remember). Have you tried building with a regular controller rather than a Grails controller? For example look at how spring boot works; you can always build out your controllers that way. Spring boot works with GORM. Grails urlmapping should still know where to point if I'm guessing correctly.
Reply all
Reply to author
Forward
0 new messages