Razor benchmarking slow when page contains a lot of html RRS feed

  • Question

  • User-1669978483 posted

    We are doing some benchmarking and have noticed the number of pages that can be simultaneously processed lowers significantly when the page contains a lot of html.


    A page with no html content generates around 40,000 results in 30 seconds.

    The same page with an additional 20 kilobytes of pure html content only generates around 6,000 results in 30 seconds.

    This seems to happen regardless of whether the html is contained in a layout page, a render page, or on the page itself.

    The results are even worse when the page contains a lot of non-html tags such as javascript.

    Any ways around this such as escaping a block of html so it is not processed by razor?

    Thank you very much for any information.


    Friday, March 15, 2019 3:22 PM

All replies

  • User-1669978483 posted

    Sorry for the misinformation.  The problem was because our benchmarking program cannot process the incoming html.  It is not a problem with ASP.NET Web Pages.  

    We were able to verify this by creating an identical page using ASP.NET Web Forms and encountered the same issue with our benchmarking program.  We were then able to resolve the issue in ASP.NET Web Forms by clearing the response buffer at the very end of the page with Response.Clear() so that the full html output was never sent to the benchmarking program.  This resulted in the full 40,000 results as expected.

    Response.Clear does not appear to work with ASP.Net Web Pages.  Is there a way of clearing the response buffer in ASP.Net Web Pages?  Thanks for any info.


    Friday, March 15, 2019 6:02 PM
  • User1724605321 posted

    Hi mike,

    Could you please show more details about the problem ? Do you try to clear content before sending to benchmarking program , Could you please show related codes ?

    Best Regards,

    Nan Yu

    Monday, March 18, 2019 2:14 AM