HOW TO OPTIMIZE RENDERING OF LARGE DATA SETS IN JSREPORTS USING LOOPS
-
How can we make the rendering of reports faster when working with large data sets . Any suggestions as to coding paradigms will be appreciated.
-
@Sesughter01 loops alone are fast, however, it depends on how large the dataset is and also the work that is being done in the loop to determine if the performance decreases. can you show an example code on playground that is slow? perhaps there are easy wins that we can recommend, but at this point i can not give you general advice about what to optimize without looking what you are currently doing
-
Okay, so I can't share the particular dataset I'm working with it's on a private server, however, maybe a description of the scale can help.
So imagine a dataset that generates a template with 20 to 30 full content in letter-size pages including some infographics. And all that data is passed dynamically using an API. From my experience running the render command, it takes at least 3mins or 4 for the report to render as against less than a minute for a two-page report
-
How come I can't find the component feature in my studio? Please how do I get it?
-
So imagine a dataset that generates a template with 20 to 30 full content in letter-size pages including some infographics
it is hard to tell you how to optimize something i don't have full visibility but it seems to me that in this case the loop is not the slowest part, but rather the pdf generation handled by chrome (assuming you are using chrome-pdf recipe), which is slow at generating a table with a lot of rows.
if you render the template in the studio with the same data that the api send, what do you see in the studio profile? that should give you some hints about what took the most part in the render.
the component should be there if you installed jsreport from npm, are you installing this way?