The problem in performance test

Stimulsoft Reports.NET discussion
Post Reply
chenxusong
Posts: 2
Joined: Thu Oct 15, 2009 7:50 pm

The problem in performance test

Post by chenxusong »

Hi,stimulsoft.10000 records I used to do testing,Test results far from satisfactory,loaded time required 1 minute,memoy need more 400m.Open three consecutive test,iis Collapse!!!! memory uesd 1.2g! In load Test,500 records, Concurrent users less than 5!!!!! please indicate the error in the following code!thanks vert mush!

Code: Select all

static int TOP = 0;
        static WebDemo() {
            StiConfig.InitWeb();
            StiReport.HideExceptions = false;
            StiReport.HideMessages = false;
            TOP = int.Parse(System.Configuration.ConfigurationManager.AppSettings["top"].ToString());
        }
        Stopwatch sw;
        DataTable dt = new DataTable("COPTC");
        DataSet ds = new DataSet("COPTC");
        StiReport report;
        long initDataTime = 0;
        long initReport = 0;
        bool isLoadFormDll=false;
        /// 
        /// ?????
        /// 
        private void InitDataSoure() {
            using (SqlConnection conn = new SqlConnection("Password=111111;Persist Security Info=True;Data Source=192.168.101.135;Integrated Security=False;Initial Catalog=DEMO;User ID=sa")) {
                SqlCommand cmd = conn.CreateCommand();
                cmd.CommandText = @"SELECT top " + TOP.ToString() + @" COPTC.*, COPTD.*, CMSMQ.MQ001, CMSMQ.MQ002, CMSMQ.MQ034, COPMA.MA002,
              COPMA.MA006, CMSMV.MV002, CMSMB.MB002, CMSME.ME002,CMSMA.MA092
            FROM COPTC LEFT JOIN
              COPTD ON COPTC.TC001 = COPTD.TD001 AND COPTC.TC002 = COPTD.TD002 LEFT JOIN
              CMSMQ ON COPTC.TC001 = CMSMQ.MQ001 LEFT JOIN
              COPMA ON COPTC.TC004 = COPMA.MA001 LEFT JOIN
              CMSMV ON COPTC.TC006 = CMSMV.MV001 LEFT JOIN
              CMSMB ON COPTC.TC007 = CMSMB.MB001 LEFT JOIN
              CMSME ON COPTC.TC005 = CMSME.ME001,CMSMA";
                cmd.CommandType = CommandType.Text;
                using (SqlDataAdapter sda = new SqlDataAdapter(cmd)) {
                    sda.Fill(dt);
                    ds.Tables.Add(dt);
                }
            }
        }
        /// 
        /// ???????
        /// 
        private void InitReport() {

            string path = Server.MapPath("");
            if (File.Exists(path + "\\Report3.dll")) {
                report = StiReport.GetReportFromAssembly(path + "\\Report3.dll", false);
                isLoadFormDll = true;
                report.RegData("COPTC", ds);
                report.Render(true);
            }
            else {
                report = new StiReport();
                report.Load(path + "\\Report3.mrz");

                report.Dictionary.Databases.Clear();
                report.DataSources.Clear();
                report.DataStore.Clear();
                if (report.CompiledReport != null) report.CompiledReport.DataStore.Clear();
                report.RegData("COPTC", ds);
                report.Dictionary.Synchronize();
                StiReport.CompileReportsToAssembly(path + "\\Report3.dll", new StiReport[] { report }, StiReportLanguageType.CSharp);
                report.Render(false);
            }       
        }

        protected void Page_Load(object sender, System.EventArgs e) {
            sw = Stopwatch.StartNew();
            if (!IsPostBack) {
                
                InitDataSoure();
                sw.Stop();
                initDataTime = sw.ElapsedMilliseconds;
                
                sw.Start();
               
                Session["report"] = ds;
            }
            else {
                ds = Session["report"] as DataSet; ;
            }

            InitReport();
            sw.Stop();
            initReport = sw.ElapsedMilliseconds - initDataTime;
            sw.Start();
            
            StiWebViewer1.Report = report;
            this.Unload += new EventHandler(WebDemo_Unload);

        }

        void WebDemo_Unload(object sender, EventArgs e) {
            //?????
            sw.Stop();
            string path = Server.MapPath("") + "\\log.txt";
            using (FileStream stream = System.IO.File.Open(path, FileMode.OpenOrCreate)) {
                using (StreamWriter writer = new StreamWriter(stream)) {
                    stream.Position = stream.Length;
                    writer.WriteLine(DateTime.Now.ToString());
                    writer.WriteLine(Page.IsPostBack ? "??????" : "???????");
                    if (!Page.IsPostBack) { writer.WriteLine(isLoadFormDll ? "?????dll????" : "?????????????"); }
                    writer.WriteLine("Report load data time:"+initDataTime.ToString());
                    writer.WriteLine("Report init time:" + initReport.ToString());
                    writer.WriteLine("Report load time:" + sw.ElapsedMilliseconds.ToString(), EventLogEntryType.Information);
                    //writer.WriteLine("??????:?" + (memoryChanged / 1024).ToString("0,0") + "K,?:" + (GC.GetTotalMemory(false) / 1024).ToString("0,0") + "K");
                    writer.WriteLine("___________________________________");
                }
            }
        }
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

The problem in performance test

Post by Jan »

Hello,
loaded time required 1 minute
What you mean under this phrase? Time to load report? Time to render report?

Also i need to know how many pages in your report?

Thank you.
chenxusong
Posts: 2
Joined: Thu Oct 15, 2009 7:50 pm

The problem in performance test

Post by chenxusong »

Jan wrote:Hello,
loaded time required 1 minute
What you mean under this phrase? Time to load report? Time to render report?

Also i need to know how many pages in your report?
Thank you.
this is my log:
10000 records,2503 pages
Report load data time:2387
Report init time:58904(Time to init and render report)
Report page load time:61346(Time to load the page,Crystal Report is 15425ms)

5000 records,1257 pages
Report load data time:953ms
Report init time:28336ms
Report page load time:29345ms

1000 records,235 pages
Report load data time:202ms
Report init time:4999ms
Report page load time:5256ms
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

The problem in performance test

Post by Edward »

Hi

Could you please send us test report and data for it. It is difficult to say something definite without it.

If possible then send them to support[at]stimulsoft.com

Thank you.
Post Reply