Declined
Last Updated: 06 Jul 2021 09:46 by ADMIN
Michael
Created on: 01 Jul 2021 17:29
Category: SpreadProcessing
Type: Bug Report
0
Blazor Web Assembly: Importing XLSX file (from MemoryStream) very slow

Importing XLSX file in Blazor Web Assembly for .NET 5.0 is very slow.

 

          <InputFile OnChange="@HandleFileSelected" />

 

async Task HandleFileSelected(InputFileChangeEventArgs e)

{

   var ms = new MemoryStream((int)e.File.Size);
        Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
        using (Stream ey = e.File.OpenReadStream(e.File.Size))
        {
            await ey.CopyToAsync(ms,(int)e.File.Size);
            ey.Close();
        }
        oWorkbook = formatProvider.Import(ms);

  }  

1 comment
ADMIN
Tanya
Posted on: 06 Jul 2021 09:46

Hello Michael,

Importing data in Blazor WASM is a very slow operation that will take a long time in the framework due to the many smaller operations that need to be performed internally to parse the content. I highly recommend you send to the client only what it needs at the moment and perform the data operations on the server as this will provide you with a much better performance.

I also advise you to review the Slow Performance section of our documentation for more tips and ideas on improving your app's performance: https://docs.telerik.com/blazor-ui/troubleshooting/general-issues#slow-performance.

Hope this is helpful.

Regards,
Tanya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.