Jump to content

Search the Community

Showing results for tags 'speed'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 2 results

  1. Specs: Delphi XE7, VCL, windows 7, Dell laptop (i3 core, 2.40GHz) I have been playing around with the Listview control, (via ViewStyle=vsReport) learning how to add items at runtime through code (not using a database/binder), for 100 to a few thousand items. Again, just playing around with throwing together a quick listview of data, and seeing if there is use for it versus going the database dataset route. Note, because I was self-learning about listview from scratch, I did have a lot of trouble figuring out how to populate the listview. And now that I know how to, I am also sharing it here for reference for others struggling to do the same. Below, is the code snippet of how I created the initial fields and then populate them. The ViewStyle should be set to vsReport in the properties section in order to show a table column layout at run time. It works and that's all that matters at this point in this indeviour. procedure TForm1.btnAddClick(Sender: TObject); var itm : TListItem; Col : TListColumn; s : string; et : int64; SW : TStopwatch; begin Col := lv1.Columns.Add; Col.Caption := 'LN'; Col.Alignment := taLeftJustify; Col.Width := 30; Col := lv1.Columns.Add; Col.Caption := 'ItemNo'; Col.Alignment := taLeftJustify; Col.Width := 60; Col := lv1.Columns.Add; Col.Caption := 'Desc'; Col.Alignment := taLeftJustify; Col.Width := 160; setlength(ary,10); // create the array length (1,2,3,4,5,6,7,8,9,0) chars beep; SW := TSTopWatch.StartNew; // start timing it lv1.Items.BeginUpdate; for i := 0 to 25000 do begin // ary := genRandValues; // generate random numbers ie (2,9,8,4,7,5,6,0,1,3) s:=listtostr(ary); // convert array list into a string var ie ('2984756013') itm:=lv1.Items.Add; // create a row itm.Caption := i.ToString(); // add the major field, ie 'LN', thus the populate with variable i as line numbers itm.SubItems.Add(''); itm.SubItems[0]:= s; // itemno ie '2984756013', and so on. itm.SubItems.Add(''); itm.SubItems[1]:= s; // desc ie same, ... end; lv1.Items.EndUpdate; SW.Stop; // finish timing eb1.text:=(intToStr(SW.ElapsedTicks)+' ticks / '+intToStr(SW.ElapsedMilliseconds)+' ms'); beep; end; But the problem I am having is that even when using the .BeginUpdate/.EndUpdate the speed is still a bit slow. For example, to fill a listview with 10,000 elements, it costs me about aprox 1.6 seconds run time, or for 25,000 elements, 7.6 seconds. I had a look at the earlier part of the for/loop, where I am generating the random numbers and then converting them to strings. I REM'ed them out and the time was still the same or ever-so-slightly less, maybe 1.5 seconds for instance. So that does not seem to be a major issue in slowing the listview down. Is this the maximum throughput I can expect from listview? or Is there anything else I can do to speed this up a lot more?
  2. dkjMusic

    App is faster in IDE

    I am deveoping an app in Delphi 10.3 Community Edition. At one point the program retrieves equation parameters from a MS Access datbase and calculates x's and y's for a set of plots. It does this to produce 15 TCharts with 9 line series each. I have found that these operations often take much longer to execute when I run the standalone app as compared to running the app in the IDE. Below is a table of execution times (using GetTickCOunt). The columns are TChart graph #, milliseconds in the IDE, and milliseconds for standalone. # IDE SA -- --- ----- 1 703 14890 2 875 500 3 844 14828 4 829 14844 5 875 468 6 812 500 7 906 14859 8 1281 14813 9 938 14860 10 829 14875 11 15562 14844 12 937 14859 13 927 14860 14 812 531 15 828 14868 What could explain the differences in execution times and what can I do to decrease the times for the standalone execution?
×