D
D
Denis2016-11-09 10:44:55
SQL
Denis, 2016-11-09 10:44:55

How to increase the performance of a .net 4.5 program using 50,000 database queries?

Task: write a program that counts a lot of different statistics, about 50,000 database queries in a particularly perverted form and displays them for viewing in the program itself using the FlowDocumentReader in the form of tables.
Workstation configuration: Intel core i5 2.4 GHz, 8 GB RAM, 256 GB SSD (60 free). I am using MS SQLServer Express 2012, Windows 10 pro, the program itself is in .net 4.5 WPF.
When the first hundred requests were formed, the brakes began - on ssd the result of the request is executed for about 5 seconds (it used to be 1 second), I think it will get worse further. Here is the code for generating each line:

// Строка 8.2
            this.FormN.RowGroups[0].Rows.Add(new TableRow());
            this.FormN.RowGroups[0].Rows[70].FontSize = 14;
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run(""))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run("8.2"))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run("H16"))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run(CF12.Str8_2_4()))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run(CF12.Str8_2_5()))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run(CF12.Str8_2_6()))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run("8"))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run("9"))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run("10"))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run("11"))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run("14"))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run("15"))));
            this.FormN.RowGroups[0].Rows[70].Cells.Add(new TableCell(new Paragraph(new Run("16"))));

And then, not all columns are filled yet. Methods that return a result for each cell are sql queries.
How can I speed up this whole build? Maybe I'm formatting the rows incorrectly and is there an easier way to display this table? Should I make asynchronous requests or will it not affect the work? This is my first serious programming experience.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Godless, 2016-11-09
@antej90

I think that:
The principle of software acceleration is always the same, you need to either calculate in advance, or store some of the calculations somewhere - this is memory, whether it be RAM or a disk ...
PS: listen to the polifill , it writes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question