• <menu id="w2i4a"></menu>
  • logo Stimulsoft Reports.WinForms教程-2019

    文檔首頁(yè)>>Stimulsoft Reports.WinForms教程-2019>>Stimulsoft Reports.WinForms教程:ENGINEV1和ENGINEV2內(nèi)存測(cè)試

    Stimulsoft Reports.WinForms教程:ENGINEV1和ENGINEV2內(nèi)存測(cè)試


    立即點(diǎn)擊下載Stimulsoft Reports.Ultimate最新版

    此示例比較了使用舊V1和新V2報(bào)表引擎時(shí)的內(nèi)存消耗。讓我們使用一個(gè)復(fù)雜的Master-Detail報(bào)表進(jìn)行比較。每次構(gòu)建之后,您可以調(diào)用垃圾收集器并查看內(nèi)存消耗:

    public Form1()
    {
        InitializeComponent();
        var data = new DataSet();
        data.ReadXmlSchema("..\\..\\Data\\Demo.xsd");
        data.ReadXml("..\\..\\Data\\Demo.xml");
        using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("MemoryTest.Master-Detail-Subdetail.mrt"))
        {
            report1.RegData(data);
            report1.Load(stream);
            report1.EngineVersion = Stimulsoft.Report.Engine.StiEngineVersion.EngineV1;
            report1.Compile();
        }
        using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("MemoryTest.Master-Detail-Subdetail.mrt"))
        {
            report2.RegData(data);
            report2.Load(stream);
            report2.EngineVersion = Stimulsoft.Report.Engine.StiEngineVersion.EngineV2;
            report2.Compile();
        }
    }
    private void button1_Click(object sender, EventArgs e)
    {
       report1.Render();
    }
    private void button2_Click(object sender, EventArgs e)
    {
       report2.Render();
    }
    private void button3_Click(object sender, EventArgs e)
    {
       report1.RenderedPages.Clear();
       GC.Collect();
       GC.Collect();
       GC.Collect();
    }


    private void button4_Click(object sender, EventArgs e)

    {

        report2.RenderedPages.Clear();

        GC.Collect();

        GC.Collect();

        GC.Collect();

    }

    在下面的屏幕截圖中,您可以看到示例代碼的結(jié)果。

    Stimulsoft Reports.WinForms教程:ENGINEV1和ENGINEV2內(nèi)存測(cè)試

    下載示例代碼

    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    023-68661681

    TOP
    三级成人熟女影院,欧美午夜成人精品视频,亚洲国产成人乱色在线观看,色中色成人论坛 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();