Performance - Migrating C1Report to FlexReport

Posted by: thomas.hayashi on 13 February 2020, 2:06 am EST

    • Post Options:
    • Link

    Posted 13 February 2020, 2:06 am EST

    Hello,

    Unless those two pieces of code are not equivalent, I’m measuring a considerable decrease in performance in FlexReport compared to the C1Report.

    
    C1.Win.FlexReport.C1FlexReport objFlex = new C1.Win.FlexReport.C1FlexReport();
    objFlex.Load(@"C:\temp\Report\PDF_FLEX_00001#788937#CRM-SP-51423#CORT^CORT.FLXR", "0 - Laudos");
    
    C1.C1Report.C1Report objC1 = new C1.C1Report.C1Report();
    objC1.Load(@"C:\temp\Report\PDF_C1_00001#788937#CRM-SP-51423#CORT^CORT.XML", "0 - Laudos");
    
    System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
    sw.Start();
    PdfFilter objFilter = new PdfFilter();
    objFilter.FileName = @"C:\temp\Report\Flex.pdf";
    objFlex.RenderToFilter(objFilter);
    sw.Stop();
    
    long timeFlex = sw.ElapsedMilliseconds;
    
    sw.Reset();
    sw.Start();
    objC1.RenderToFile(@"C:\temp\Report\C1.pdf", C1.C1Report.FileFormatEnum.PDF);
    sw.Stop();
    
    long timeC1 = sw.ElapsedMilliseconds;
    
    

    Points of attention:

    • I’m not measuring the load time, only the render to PDF file.
    • The FlexReport file is the migrated C1Report file. Therefore, it’s supposed to be the same(with minor adjustments).
    • I didn’t have a 100% isolated environment, but I run 3 times and got the following results (FlexReport is taking twice as much time. )

    Test 1

    C1 75544 ms

    Flex 184931 ms

    Test 2

    C1 79036 ms

    Flex 210533 ms

    Test 3

    C1 74028 ms

    Flex 184828 ms

    C1 Average 76202 ms

    Flex Average 193430 ms

    • I’ll put a link here, because the file is too big to attach (I created a big report file on purpose to get a better grasp)

      https://easyupload.io/ojc1w5

    • The pdf file of both rendering, I’m my opinion has no visual difference, but has a significant difference on size. (C1Report - 439KB vs FlexReport 6417KB)

    In the end, Am I converting PDF the wrong way or is it something else ?

  • Posted 13 February 2020, 9:33 pm EST

    Hi Thomas,

    We have escalated the case to the developers and will let you know once we get any response on this from their end.

    [Internal Tracking ID: 421087]

    Regards,

    Prabhat Sharma.

  • Posted 21 February 2020, 6:47 am EST

    First some context. I’ve opened a thread (item 4) and the given/final answer was: We cannot achieve your desired layout with this report. You need to refactor it (link below).

    https://www.grapecity.com/forums/winforms-edition/datasource-and-layout---mi

    Now that I refactored it to meet my desired layout, the performance is even worse than before. Because I don’t know if the the root cause is the same, I’m updating this thread (if not the same root please also consider this scenario).

    So my report looked like this before:

    Main report → Sub-report → list of sub-reports

    Now the report is like this (took out the middle report that held the list of sub-reports):

    Main report → list of sub-reports

    And basically they are generating the same PDF.

    The code I used to check the performance

    
    C1.Win.FlexReport.C1FlexReport objFlex = new C1.Win.FlexReport.C1FlexReport();
    objFlex.Load(@"C:\temp\Report\PDF_FLEX_00001#788937#CRM-SP-51423#CORT^CORT.FLXR", "0 - Laudos");
    
    C1.Win.FlexReport.C1FlexReport objFlexNOSUBREPORT = new C1.Win.FlexReport.C1FlexReport();
    objFlexNOSUBREPORT.Load(@"C:\temp\Report\PDF_FLEX_NOSUBREPORT_00001#788937#CRM-SP-51423#CORT^CORT.FLXR", "0 - Laudos");
    
    PdfFilter objFilter = new PdfFilter();
    System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
    sw.Start();
    objFilter.FileName = @"C:\temp\Report\Flex.pdf";
    objFlex.RenderToFilter(objFilter);
    sw.Stop();
    
    long timeFlex = sw.ElapsedMilliseconds;
    
    sw.Restart();
    objFilter.FileName = @"C:\temp\Report\FlexNOSUBERPORT.pdf";
    objFlexNOSUBREPORT.RenderToFilter(objFilter);
    sw.Stop();
    
    long timeFlexNOSUBREPORT = sw.ElapsedMilliseconds;
    
    

    The test results were the following:

    Test1

    middle sub-report 187995 ms

    NO middle sub-report 362377 ms

    Test 2

    middle sub-report 169571 ms

    NO middle sub-report 320507 ms

    Test 3

    middle sub-report 170326 ms

    NO middle sub-report 339906 ms

    Therefore, it seems it’s taking twice as much as the previous flex version (which was not correct) and four times as much as the C1 version.

    I’ll attach the used reports through the following link:

    https://easyupload.io/6t23yd

    Thanks

  • Posted 23 February 2020, 10:45 pm EST

    Hi Thomas,

    We are getting the Error 1020 Access Denied error when going through your following link:

    https://easyupload.io/6t23yd

    Kindly reattach the sample again.

    Regards,

    Prabhat

  • Posted 24 February 2020, 6:05 pm EST

    Hi Thomas,

    On running the sample attached in the following post:

    https://www.grapecity.com/forums/winforms-edition/performance---migrating-c1#original-post

    We are getting errors in both C1Report and FlexReport as shown in the attached screenshots.

    Kindly reattach the sample with correct data and a GIF file showing the issue so that we can replicate the issue at our end by following the same steps.

    Regards,

    Prabhat Sharma

    Screenshots.zip

  • Posted 27 February 2020, 4:03 am EST

    Hello,

    Well, I think the thread is kinda confusing because of my mid-way changes. Therefore, I’ll try to rephrase and organize everything again.

    The generated PDF(visually) is the same, but the reports are not exactly the same. I had to do several changes in Flex in order to achieve an equivalent C1 layout, I even had to change the internal structure of the report.

    I can’t provide a GIF with a issue, because it’s not a layout/error problem. It’s a performance issue. I’ll attach a report with fewer pages, so you can take a look.

    I used the first comment’s code to run and extract the times. Keep in mind that as the number of pages increase the time is increasing proportionally. My first results were (in miliseconds):

    Test1: 16596 (Flex) / 9170 (C1)

    Test2: 15437 (Flex) / 8169 (C1)

    Test3: 16234 (Flex) / 11423 (C1)

    Performance.zip

  • Posted 27 February 2020, 7:51 pm EST

    Hi Thomas,

    Thank you for the sample and we can observe the issue using this sample so escalating this to the developers and will let you know once we get any updates on this from developers’ end.

    [Internal Tracking ID: 422897]



    Regards,

    Prabhat Sharma.

  • Posted 8 August 2020, 4:25 pm EST

    Hi,

    The issue has been fixed in the latest version of controls i.e. 2020V2.438. You can upgrade your controls using the latest ComponentOneControlPanel utility.

    https://www.grapecity.com/componentone/download

    Regards,

    Prabhat Sharma.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels