Long duration excel generation



  • I am trying to generate excel file of about 15,000 rows and it takes a long time. According to the log file the duration is 16 seconds.

    2020-06-28T16:38:09.487Z - info: Rendering request 16375 finished in 16261 ms
    2020-06-28T16:38:19.325Z - info: Starting rendering request 16376 (user: null)
    2020-06-28T16:38:19.325Z - info: Rendering template { name: list-to-excel-v3, recipe: xlsx, engine: handlebars, preview: false }

    I am using my own template file with the default xslx confiiguration.
    Can you please explain the configuration parameters 'numberOfParsedAddIterations' and 'addBufferSize' ?
    I there away to improve the performance ?



  • Hi,

    would you be able to share the template (both jsreport and xlsx templates)?
    It's hard to say without it what could be the reason. It should normally much faster.

    Can you please explain the configuration parameters 'numberOfParsedAddIterations' and 'addBufferSize' ?

    I was never in need to use these configs and the most likely it won't help to fiddle with it, but here is the explanation:
    numberOfParsedAddIterations - the recipe parses the XML into background json during the xlsxAdd operations, after default 50 iterations it stops
    addBufferSize - the recipe is buffering the XML created using xlsxAdd and flushing to the file after the addBufferSize threshold, defaults to 50mb



  • I can share the templates. I do I do it ?



  • You can export the zip from jsreport studio and upload it somewhere.
    Or create a demo here https://playground.jsreport.net



  • I figured out that my one of my helper functions is causing the problem. It was a currency formatter that use 'Intl.NumberFormat' . After optimizing the code, the excel generation of 15000 rows now takes 7 seconds(reduced form 16 seconds) which I think is more reasonable.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.