Hello,
I have a small question regarding a performance difference between using the export function and the async export function on the UltraGridExcelExporter (version 11.2.20112.1010).I noticed that when using the export function its up to 3 times faster than using the async export.
A simple example that exports 54539 rows is included, as you will see:- export takes up to 94852 milliseconds- async export takes up to 325792 milliseconds
I noticed the cpu only takes up to a third of its total "power" when using async export; which explains the difference in timings.But my question is: why does the async export only uses a third of the cpu resources available?
We would like to use async export but if it's that much slower we are "forced" to use the normal export functionalities.
Thanks for your advice.
Hi,
When exporting asynchronously, the export is done using slices of time. That means that the component does a little bit of exporting, then releases processing back to the application for a time, then does a little but more of the export, etc.
That's the nature of asynchronous exporting. So exporting asynchronously will always take longer than synchronous exporting. That's just the laws of physics. The time has to come from somewhere. :)
The trade off is, of course, that during the asynchronous export operation, the UI of the entire application doesn't lock up - so the user can still do other things.
You might be able to speed up the asynchronous export by giving more time to the export process and less free time to the application. You can adjust the time slices using a couple of static properties:
Infragistics.Win.UltraWinGrid.AsynchronousExportManager.AsynchronousExportDurationInfragistics.Win.UltraWinGrid.AsynchronousExportManager.AsynchronousExportInterval
By increasing the duration or deceasing the interval you will give more time to the export and less time to the application. The risk there is that the UI for the rest of the application might not be as responsive while the export is in progress - and this may vary based on the speed of the machine, so just because it's fine on your machine doesn't necessarily mean it will be fine on a user's machine if their machine is slower than yours.
Hello Mike,
i have got the same perfomance problems on export huge data from ultragrid to excel (200.000 rows / 50 columns).
I am having problems to understand, that the cpu usage is not greater than 4% with exportAsync and not over 14 % on regular export() method.
Why isn't it possible to use all cpu kernels (more than one cpu-core) by higher cpu usage than 4% - 10% working power.
Here's my code example:
Dim ultraExcelExporter As New UltraGridExcelExporter() Try 'AddHandler ultraExcelExporterAsync AddHandler ultraExcelExporter.InitializeColumn, AddressOf InitializeColumn_OnExport _ultraWorkBook = New Workbook(pWorkbookFormat) If pFileName = String.Empty Then _ultraWorkBook.Worksheets.Add("Tabelle1") Else Dim worksheetName As String = pFileName.Substring(0, Math.Min(pFileName.Length, 31)) _ultraWorkBook.Worksheets.Add(worksheetName) End If Dim oldVisible As New ArrayList Dim counter As Integer = 0 For Each col As UltraGridColumn In Me.DisplayLayout.Bands(0).Columns If Not col.IsChaptered Then Dim colInfo As New clsColInfo(clsPropertyInfo.IsDesignMode(Me), Me.Username, Me.Name, FindForm().Name, _ col.Header.Caption, col.Key) oldVisible.Add(col.Hidden) col.Hidden = Not colInfo.ColExcelExport End If Next For Each col As UltraGridColumn In Me.DisplayLayout.Bands(0).Columns If Not col.IsChaptered Then col.Hidden = oldVisible.Item(counter) counter += 1 End If Next RemoveHandler ultraExcelExporter.ExportEnded, AddressOf ExportFinished AddHandler ultraExcelExporter.ExportEnded, AddressOf ExportFinished deactivatedControls = New List(Of String)() ' ultraExcelExporter. SetControlsActive(False, ParentForm.Controls)
ultraExcelExporter.ExportAsync(Me, _ultraWorkBook)
Async Export is up to 3 times slower than regular Export()
I hope you can help us to speed up the Excel export.
Greetings,
A. Nikolov
Mike,
First of all thanks for your reply and short lesson in the behaviour of time and physics :-).
I assumed the async export would behave a bit like a background thread, consuming all the available resources until a thread with a higher priority would need more resources thereby causing the background thread to have less resources and so on.
But I have been playing a bit with the 2 properties and these seem to be more than adequate for what I need.
Thank you for the assistance.