First run performance on web

Last post 02-28-2012, 6:39 AM by muhammad.ijaz. 6 replies.
Sort Posts: Previous Next
  •  01-25-2012, 3:46 AM 357136

    First run performance on web .NET

    Hello,

    I am developing a sort of web application, which runs on Sharepoint, therefore GAC; that converts documents to PDF as a basic feature using Aspose. This convertion are done via a handler(ASHX). 

    The problem is that the first time the application runs(like after GAC deployment) it takes quite some time to convert a simple file. This doesn't happen just once though, but rather every time a different product is used. Let me give you a concrete scenario. File sizes are pretty much the same.
    These happen sequentially:

    file.doc (about 8 seconds)
    file2.doc (1 second)
    file3.doc (1 second) and so on
    file.ppt (about 8 seconds)
    file2.ppt (about 1 second) and same scenario
    same scenario with aspose.cells, aspose.diagram etc.

    I have tried to create a dummy instance of document/worksheet/etc. for each product when the application is first deployed; and even converting them to PDF into a dummy stream. However, it only saved a couple of seconds.

    It is a bit trivial issue, but it would be good to get rid of. How can I avoid this?

    Thanks,
    Natan
    Filed under: . Net;Performance
     
  •  01-25-2012, 5:24 PM 357308 in reply to 357136

    Re: First run performance on web

    Hi Natan,

    Thanks for your inquiry.

    I am a technical support person for Aspose.Words. In Aspose.Words I suppose such a once off delay may be caused by the loading of fonts and other resources. You can try precaching these by creating a new Document and calling UpdateFields and UpdatePageLayout.

    Please let me know if this helps. Regarding the other products, the support developers from those teams will answer shortly.

    Thanks,

    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
  •  01-26-2012, 4:34 AM 357382 in reply to 357308

    Re: First run performance on web

    Hi Adam,

    Yes, that affected the result significantly though not as much as converting another document first. However, it is good enough. Thank you.

    I looked for similar methods to do the same on other products, yet I have failed. I'll be waiting for those.

    Natan
     
  •  02-20-2012, 10:01 AM 362741 in reply to 357382

    Re: First run performance on web

    Hello again,

    Is there any update on this issue? I'm still waiting for the cache tweaks on other products.

    Regards,
    Natan
     
  •  02-27-2012, 3:13 AM 364137 in reply to 362741

    Re: First run performance on web

    Hi Natan,

    Regarding Excel spreadsheets rendering (by using Aspose.Cells component), you may precache using the following sample code, e.g

    Workbook workbook = new Workbook();
                 workbook.Worksheets[0].Cells["A1"].PutValue("Hello");
                using(MemoryStream ms = new MemoryStream())
                {
                 workbook.Save(ms, SaveFormat.Pdf);
                }


    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  02-28-2012, 5:55 AM 364455 in reply to 364137

    Re: First run performance on web

    Hi Natan,

    Regarding .PPT and .PPTX rendering (by using Aspose.Slides for .NET component), you may precache using the following sample code, e.g

                      var ppt = new Presentation();
                      var sldppt = ppt.Slides[0];
                      using (MemoryStream msppt = new MemoryStream())
                      {
                            ppt.Save(msppt, SaveFormat.Pdf);
                      }

                      var pptx = new PresentationEx();
                      var sldpptx = pptx.Slides[0];
                      using (MemoryStream mspptx = new MemoryStream())
                      {
                            pptx.Save(mspptx, SaveFormat.Pdf);
                      }

    Thank you.

    Best Regards

    Hassan Farrukh
    Support Developer
    Aspose Sialkot Team

    Aspose - The .NET and Java Component Publisher
     
  •  02-28-2012, 6:39 AM 364465 in reply to 362741

    Re: First run performance on web

    Hi Natan,

    You can use the following code for Visio diagrams.

    Diagram diagram = new Diagram();

    PdfSaveOptions options = new PdfSaveOptions();

    options.SaveFormat = SaveFileFormat.PDF;

     

    using (MemoryStream ms = new MemoryStream())

    {

        diagram.Save(ms, options);

    }

     

    Best Regards,


    Muhammad Ijaz
    Support Developer, Aspose Sialkot Team
    Contact Us
    http://www.aspose.com
    Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML