Autor Beitrag
christoph
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

Win XP(SPack1),Win 2000(Spack3)
Delphi 6(Spack2)
BeitragVerfasst: Sa 24.05.03 19:44 
Hallo folgendes Problem....
Ich muss eine grosse Anzahl von Items laden (ca 11.000 Einträge)
ausblenden Delphi-Quelltext
1:
Listbox1.Items.LoadFromFile(progdir+'gross.txt');					


Nur leider dauert das anzeigen fast bis zu 7 Sekunden

Gibt es eine möglichkeit das zu beschleunigen ??

Gruss
Christoph


Zuletzt bearbeitet von christoph am Sa 24.05.03 20:02, insgesamt 2-mal bearbeitet
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: Sa 24.05.03 19:50 
Veresuch mal:
ausblenden Delphi-Quelltext
1:
2:
3:
  ListBox1.Items.BeginUpdate;
  Listbox1.Items.LoadFromFile(progdir+'gross.txt'); 
  ListBox1.Items.EndUpdate;
christoph Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

Win XP(SPack1),Win 2000(Spack3)
Delphi 6(Spack2)
BeitragVerfasst: Sa 24.05.03 19:57 
Hab ich schon getestet ...
(ohne Wirkung)
BeginUpdate und EndUpdate zeigt anscheinend nur Wirkung bei Items.add

Gruss
Chris
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 24.05.03 21:49 
schreibe doch selbst eine loadform rutine. und mach es so, das du nich alles auf einmal läds also erstmal eine kleine daten mänge von 200 datein lädts, drück der benutzer dann auf weiter dann die nächsten 200 und so weite, kannst dir ja mal mein IconReader ansehen(unter Freeware Projkete).... hat vileicht noch einige fehler, aber es funktioniert ;)

_________________
MFG
Michael Springwald, "kann kein englisch...."
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: Sa 24.05.03 21:54 
Du willst dem User zumuten, ~55 mal auf "Weiter" zu klicken!?
Also so ein Programm würde SOFORT wieder fliegen...
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 24.05.03 22:01 
ist aber die beste lösung. was ist besser:
~55 mal auf weiter zu klicken bzw. aus der liste auswählen welche seite du haben willst oder 7 sekunden zu warten ?

_________________
MFG
Michael Springwald, "kann kein englisch...."
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: Sa 24.05.03 22:14 
7 Sekunden warten, geht schneller.
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 24.05.03 23:12 
gut, dann must du es so lassen, weil ne besser lösung gibt es nämlich nicht:)

_________________
MFG
Michael Springwald, "kann kein englisch...."
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: Sa 24.05.03 23:26 
Also ich hab ein Textfile eben mit genau 11000 Einträgen mal in eine Listbox mittels LoadFromFile eingelesen. Das dauert hier (Athlon 1.1) so 1-2 Sekunden nur, geht doch?
christoph Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

Win XP(SPack1),Win 2000(Spack3)
Delphi 6(Spack2)
BeitragVerfasst: Sa 24.05.03 23:58 
Solange ein Item nur als 'Das ist ein Test' ausieht ist das kein Problem...

aber meine Items sind nun mal länger....die sehn bei mir so aus...
(ist ne playlist....)
C:\Audiogalaxy\1\Jan Wayne - Because the night (Club Mix).mp3;48;JAN WAYNE;JAN WAYNE;BECAUSE THE NIGHT (CLUB MIX);BECAUSE THE NIGHT;6:10.442 ;120,00;370442;Mp3


Gruss
Christoph
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: So 25.05.03 00:15 
Jo, das dauert ERHEBLICH länger.
Damit ungefähr genauso lang:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
var
  f: textfile;
  tmp: string;
begin
  if OpenDialog1.Execute then begin
      AssignFile(F, Opendialog1.Filename);
      Reset(F);
      ListBox1.Items.BeginUpdate;
      while not eof(f) do begin
        readln(f,tmp);
        ListBox1.Items.Add(tmp);
      end;
      ListBox1.Items.EndUpdate;
      CloseFile(F);
  end;

Insofern ist da wenig raum für Performancetweaks. :/

Moderiert von user profile iconUGrohne: Delphi-Tags korrigiert (fehlte ein ] :wink:)
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: So 25.05.03 00:27 
Ich hab dazu grad so ne Idee, kanns aber grad net testen. Du könntest doch sagen wir mal die ersten 200 laden, das geht ja schnell, und dann muss der User ja zwangsläufig runterscrollen. Meines WIssens gibt es für dieses Vorgehen ein Ereignis. Sollte er also an das Ende herankommen, dann könntest Du doch weitere 200 laden. Weiß net wirklich, ob das funktionieren würde, nur mal so ein Hirngespinst :wink: