I have a report done in freemarker that is slightly more than 2000 rows.
I manipulate it with maps inside of maps and it bogs down the browser and my system when I run the full report. When I chop away all the freemarker Map manipulation stuff and just dump the 2000 rows to the screen, it runs much faster, so I'm looking for a way to make my freemarker more efficient. I've tried replacing maps with html strings, but it does not seem to help. Can ofbiz do output buffering? If not, how should I approach this issue? Thanks. here is part of .ftl file: (completionMap has 2271 members. $person right now ends up being a string with the data rendered as a row in the report - just to see if it speeds up.) I believe the issue is with object wrapping but I don't know enough about it to know how to fix it. <#assign completionList = completionMap.keySet() /> <#list completionList as key> <#assign person = personInfoMap[key]> <tr> ${person} </tr> </#list> </table> Tim McGuire |
Tim,
It's hard to offer advice with such sketchy information. What revision of OFBiz are you using? How is the data being prepared? What do you mean by "freemarker Map manipulation stuff"? -Adrian Tim McGuire wrote: > I have a report done in freemarker that is slightly more than 2000 rows. > I manipulate it with maps inside of maps and it bogs down the browser > and my system when I run the full report. When I chop away all the > freemarker Map manipulation stuff and just dump the 2000 rows to the > screen, it runs much faster, so I'm looking for a way to make my > freemarker more efficient. I've tried replacing maps with html strings, > but it does not seem to help. > > Can ofbiz do output buffering? If not, how should I approach this > issue? > Thanks. > > here is part of .ftl file: > (completionMap has 2271 members. $person right now ends up being a > string with the data rendered as a row in the report - just to see if it > speeds up.) > I believe the issue is with object wrapping but I don't know enough > about it to know how to fix it. > > <#assign completionList = completionMap.keySet() /> > <#list completionList as key> > <#assign person = personInfoMap[key]> > <tr> > ${person} > > </tr> > > </#list> > > </table> > > Tim McGuire > |
yes, I suppose it would help to offer more info.
version of ofbiz: 4.0 I am preparing the data in a beanshell with delegator.findByCondition() and loading the result into two maps that I throw into the context and display with the FTL. When I dump the data straight out to the FTL, it loads quick enough. That is, a basic <#list> </#list> lists the 2000 odd rows. by Map manipulation, I mean that I have a 2 maps of EntityValues inside Maps of Maps. If I leave the maps out of it, it seems to run much faster. Tim McGuire Integral Business Solutions phone: (651) 259-1008 > -----Original Message----- > From: Adrian Crum [mailto:[hidden email]] > Sent: Wednesday, September 26, 2007 4:43 PM > To: [hidden email] > Subject: Re: accomplish output buffering in ofbiz > > Tim, > > It's hard to offer advice with such sketchy information. What > revision of OFBiz are you using? How is the data being > prepared? What do you mean by "freemarker Map manipulation stuff"? > > -Adrian > > Tim McGuire wrote: > > > I have a report done in freemarker that is slightly more > than 2000 rows. > > I manipulate it with maps inside of maps and it bogs down > the browser > > and my system when I run the full report. When I chop away all the > > freemarker Map manipulation stuff and just dump the 2000 > rows to the > > screen, it runs much faster, so I'm looking for a way to make my > > freemarker more efficient. I've tried replacing maps with html > > strings, but it does not seem to help. > > > > Can ofbiz do output buffering? If not, how should I approach this > > issue? > > Thanks. > > > > here is part of .ftl file: > > (completionMap has 2271 members. $person right now ends up being a > > string with the data rendered as a row in the report - just > to see if > > it speeds up.) I believe the issue is with object wrapping > but I don't > > know enough about it to know how to fix it. > > > > <#assign completionList = completionMap.keySet() /> > > <#list completionList as key> > > <#assign person = personInfoMap[key]> > > <tr> > > ${person} > > > > </tr> > > > > </#list> > > > > </table> > > > > Tim McGuire > > > > |
Three things that come to mind right away:
1. There was a recent bug fix to the freemarker rendering code - check to see if you're using the version that includes the bug fix. 2. Use EntityListIterator with your findByCondition result to help speed things up. 3. Simplify the objects being passed to freemarker. Why is it necessary to use Maps (keeping in mind the GenericValue class implements the Map interface)? See if there is a simpler way to pass data from bsh to ftl. -Adrian Tim McGuire wrote: > yes, I suppose it would help to offer more info. > > version of ofbiz: 4.0 > > I am preparing the data in a beanshell with delegator.findByCondition() > and loading the result into two maps that I throw into the context and > display with the FTL. > > When I dump the data straight out to the FTL, it loads quick enough. > That is, a basic <#list> </#list> lists the 2000 odd rows. > > by Map manipulation, I mean that I have a 2 maps of EntityValues inside > Maps of Maps. If I leave the maps out of it, it seems to run much > faster. > > Tim McGuire > Integral Business Solutions > phone: (651) 259-1008 > > >>-----Original Message----- >>From: Adrian Crum [mailto:[hidden email]] >>Sent: Wednesday, September 26, 2007 4:43 PM >>To: [hidden email] >>Subject: Re: accomplish output buffering in ofbiz >> >>Tim, >> >>It's hard to offer advice with such sketchy information. What >>revision of OFBiz are you using? How is the data being >>prepared? What do you mean by "freemarker Map manipulation stuff"? >> >>-Adrian >> >>Tim McGuire wrote: >> >> >>>I have a report done in freemarker that is slightly more >> >>than 2000 rows. >> >>>I manipulate it with maps inside of maps and it bogs down >> >>the browser >> >>>and my system when I run the full report. When I chop away all the >>>freemarker Map manipulation stuff and just dump the 2000 >> >>rows to the >> >>>screen, it runs much faster, so I'm looking for a way to make my >>>freemarker more efficient. I've tried replacing maps with html >>>strings, but it does not seem to help. >>> >>>Can ofbiz do output buffering? If not, how should I approach this >>>issue? >>>Thanks. >>> >>>here is part of .ftl file: >>>(completionMap has 2271 members. $person right now ends up being a >>>string with the data rendered as a row in the report - just >> >>to see if >> >>>it speeds up.) I believe the issue is with object wrapping >> >>but I don't >> >>>know enough about it to know how to fix it. >>> >>> <#assign completionList = completionMap.keySet() /> >>> <#list completionList as key> >>> <#assign person = personInfoMap[key]> >>> <tr> >>> ${person} >>> >>> </tr> >>> >>></#list> >>> >>></table> >>> >>>Tim McGuire >>> >> >> > |
Free forum by Nabble | Edit this page |