I’m working with custom editor that allows to render output data in different format and struggling with an issue that prevents overall document assembly. For example xlsx document with 20k rows and 3 columns takes seconds to complete with urs method and mine code, while assembling similar document in docx type takes several time (similar case takes up to 4-5 min), after researching a code found that InsertHtml() foreach cell takes from 33k ticks to 108k ticks. Inserting typical cases where it just a value or value with standart styles like color, text-align and background-color
Is that possible to create an issue to optimize a little bit that method
Gonna show u console output where is out local methods and your InsertHtml
@bloodboilAaromatic
It sounds like you’re experiencing performance issues with the InsertHtml()
method when working with large documents in Aspose.Words. Here’s a structured approach to address the problem:
Cause: The performance issues may stem from the complexity of the HTML being inserted and the number of calls to the InsertHtml()
method.
Solution: Here are several strategies to optimize the process:
-
Batch Processing: Instead of inserting HTML for each cell individually, batch your HTML content. This reduces the number of calls to InsertHtml()
and can significantly improve performance.
-
Minimize HTML Complexity: Simplify the HTML content you are inserting. Complex styles and structures can slow down processing time. Limit the use of inline styles and keep the HTML as straightforward as possible.
-
Use DocumentBuilder: For inserting simple text or basic formatting, consider using the DocumentBuilder
class instead of InsertHtml()
. This approach can be more efficient for straightforward content.
-
Profile Your Code: Utilize profiling tools to identify specific bottlenecks in your code. This will help you pinpoint which parts of the InsertHtml()
method are consuming the most time.
-
Update to Latest Version: Ensure you are using the latest version of Aspose.Words, as performance improvements and bug fixes are regularly included in updates.
Next Steps: Implement the suggested optimizations and monitor the performance. If issues persist, consider reaching out to Aspose support to report your performance concerns with InsertHtml()
. They may provide further insights or optimizations tailored to your specific use case.
Please let me know if you need any further assistance!
@bloodboilAaromatic,
It appears that you are utilizing the Aspose.Words API for your task, which seems to have led to the performance issue you mentioned. To ensure you receive the best assistance, your thread will be moved to the appropriate category, where one of our colleagues from the Aspose.Words team will review it and provide support soon.
U gonna move it urself or i need recreate topic?
@bloodboilAaromatic,
I have moved it to Aspose.Words forum category now. Please stay tuned.
@bloodboilAaromatic Could you please provide your input document and code that will allow us to reproduce the problem? Or create a simple console application that will demonstrate the problem. We will check the issue and provide you more information.
I cannot provide u a code, cause it more complex, i have only a performance issue with that method, nothing else
@bloodboilAaromatic Thank you for additional information. But unfortunately, it is still not clear how we can reproduce the problem on our side.
Just call InsertHtml() when working with tables, execution time for each cell too long, that’s it.
@bloodboilAaromatic
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-28606
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Thanks a lot that was exactly what was i expecting
1 Like