title: Javascript: I want to save a PDF from material table. After clicking on download PDF, it's taking more than few minutes and screen freezes
body: <p>I have more than 150k records in my table. what mistake I'm doing?</p>
  <p>Function I'm calling.</p>
  <pre><code>const exportPDF = () =&gt; {
  
      var doc;
      if (download_fields.length &lt; 9) {
          doc = new jsPDF('p', 'mm', [297, 210]);
      }
      else {
          doc = new jsPDF('l', 'pt', [12000, 12000]);
      }
      const data = download_data.map(elt =&gt; {
          let download_arr = []
          download_fields.forEach(e =&gt; { Object.entries(elt).forEach(entry =&gt; &lt;&gt;{e === entry[0] ? download_arr.push(entry[1]) : null}&lt;/&gt;) })
          // console.log(download_arr)
          return (
              download_arr
          )
      });
  
      doc.autoTable(download_headers, data, {
          margin: { top: 15 },
          styles: { fontSize: 14, halign: 'center' },
          theme: &quot;grid&quot;,
          didParseCell: function (data) {
  
              if (data.row.index === 0 &amp;&amp; data.section !== 'body') {
                  data.cell.styles.fillColor = [0, 102, 204];
                  data.cell.styles.lineWidth = 2;
              }
          }
      });
  
      doc.save(`${file_name}.pdf`);
  }
  </code></pre>
  <p>Line where I'm creating data is taking more time to execute. Till then I'm unable to do any other task on the screen (freeze).
  Talking time is fine if we find any solution to do other work while it's generating PDF parallelly.</p>