g***@fdlservizi.com
2018-03-27 08:51:00 UTC
I have a strange performance behavior with google guice in my project
My company have a project that use google guice and groovy.
I have to admin: I do not know well google guice (it's been chosen from
other than me)
i have this case, it's not easy to explain, let's try
I have this classes
a groovy class with this method (Class A)
public Integer resMesiFatturazionePerAnno(Integer anno) {
[some code]
def bollelett = getListByQuery(BollaLetture, """select bl.* from
bolla_letture bl, bolla b, fat where
b.id_centro_subentro = ? and
b.id_fat = fat.id
and
fat.dt>=? and
fat.dt<= ? and
bl.id_bolla = b.id
ORDER by bl.dt asc
""",
getCentroSubentroId(), inizioAnno, fineAnno)
[some code]
}
other groovy class with this method (CLASS B)
public <T extends BOIf> List<T> getListByQuery(Class<T> c, String query,
Object... list) throws java.lang.Exception {
[some code]
for (Map h : this.queryToMapList(query, list)) {
long test1 = System.currentTimeMillis();
T bo = Guice.createInjector(new BillModule(), new
CacheModule()).getInstance(c);
System.out.println("ciclomap: " + (System.currentTimeMillis()
- test1));
[some code]
}
System.out.println("getListByQuery: " +
(System.currentTimeMillis()-test));
return l;
}
if you see, the resMesiFatturazionePerAnno method use the getListByQuery
method, and getListByQuery have Guice createInjector inside
resMesiFatturazionePerAnno is invoked from codes inside a batch script, so
invoken 20/30.000 times over different instance of CLASS A
depends from where i invoke resMesiFatturazionePerAnno in some case i can
see that this lines
long test1 = System.currentTimeMillis();
T bo = Guice.createInjector(new BillModule(), new
CacheModule()).getInstance(c);
System.out.println("ciclomap: " + (System.currentTimeMillis() - test1));
take 10 milliseconds to executes, but if invoked from other circumstance it
take 20ms to executes (in my case 10ms more for EVERY time the
getListByQuery it's called it's really big damage)
Can someone help me to find out why this behaviour?
My company have a project that use google guice and groovy.
I have to admin: I do not know well google guice (it's been chosen from
other than me)
i have this case, it's not easy to explain, let's try
I have this classes
a groovy class with this method (Class A)
public Integer resMesiFatturazionePerAnno(Integer anno) {
[some code]
def bollelett = getListByQuery(BollaLetture, """select bl.* from
bolla_letture bl, bolla b, fat where
b.id_centro_subentro = ? and
b.id_fat = fat.id
and
fat.dt>=? and
fat.dt<= ? and
bl.id_bolla = b.id
ORDER by bl.dt asc
""",
getCentroSubentroId(), inizioAnno, fineAnno)
[some code]
}
other groovy class with this method (CLASS B)
public <T extends BOIf> List<T> getListByQuery(Class<T> c, String query,
Object... list) throws java.lang.Exception {
[some code]
for (Map h : this.queryToMapList(query, list)) {
long test1 = System.currentTimeMillis();
T bo = Guice.createInjector(new BillModule(), new
CacheModule()).getInstance(c);
System.out.println("ciclomap: " + (System.currentTimeMillis()
- test1));
[some code]
}
System.out.println("getListByQuery: " +
(System.currentTimeMillis()-test));
return l;
}
if you see, the resMesiFatturazionePerAnno method use the getListByQuery
method, and getListByQuery have Guice createInjector inside
resMesiFatturazionePerAnno is invoked from codes inside a batch script, so
invoken 20/30.000 times over different instance of CLASS A
depends from where i invoke resMesiFatturazionePerAnno in some case i can
see that this lines
long test1 = System.currentTimeMillis();
T bo = Guice.createInjector(new BillModule(), new
CacheModule()).getInstance(c);
System.out.println("ciclomap: " + (System.currentTimeMillis() - test1));
take 10 milliseconds to executes, but if invoked from other circumstance it
take 20ms to executes (in my case 10ms more for EVERY time the
getListByQuery it's called it's really big damage)
Can someone help me to find out why this behaviour?
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/51ebdb6b-5928-4c4e-afa2-7ae58a22644f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/51ebdb6b-5928-4c4e-afa2-7ae58a22644f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.