Autor Beitrag
TheNeon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 408

Windows
VS2010 C#
BeitragVerfasst: Fr 22.10.04 16:25 
Hallo Delphianer,

nach erneuter langer Programmierpause melde ich mich zurück.
Und sofort wieder ein Problem :roll: :

Und zwar will ich mir die Registry-Schlüssel in einem TreeView anzeigen lassen, also genauso wie es der Registry Editor von Windows macht. Im Prinzip wäre es super, wenn ich das Prinzip von diesem Editor "kopieren" könnte, denn die CPU-Auslastung sind da ebenso wie die RAM-Ausbeutung gering. Lädt man die komplette Registry beim Programmstart, dauert's rund 20sec in denen die CPU arbeiten muss (99%) und der Speicherbedarf sieht mit rund 40MB (je nach Registrygröße) alles andere als Berauschend aus.

Weiß jemand, wie ich es besser machen kann??
.... also mehr in die Richtung von Windows's Registry Editor?!


Will bzw. muss später auch noch die Werte und so ausgeben, aber das dürfte ein kleineres Problem sein ... hoffe ich.


Wäre über Hilfe sehr sehr dankbar.


Salut,
TheNeon :wave:


Zuletzt bearbeitet von TheNeon am Sa 23.10.04 11:53, insgesamt 1-mal bearbeitet
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 22.10.04 18:40 
Erzeuge die Unterschlüssel nur, wenn der User diese Expandiert.
Ob Unterschlüssel vorhanden sind, solltest du beim Anzeigen bzw. beim dynamischen nachladen der Schlüssel prüfen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
TheNeon Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 408

Windows
VS2010 C#
BeitragVerfasst: Fr 22.10.04 21:04 
habs versucht, klappt an sich ganz gut, aber das Laden von CLASSES_ROOT ist eine Qual ... rund 15sec

woran kann das liegen und wie kann ich es beheben ?
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 23.10.04 02:44 
Naja, der liebe HKCR :D

Kapselst du deine Update-Operationen beim hinzufügen von neuen Knoten mit Aufrufen von BeginUpdate und EndUpdate? Wenn nicht, wäre das ein heißer Tipp. Reduziert die Ladezeit auf sicherlich ~3 Sekunden :D

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
TheNeon Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 408

Windows
VS2010 C#
BeitragVerfasst: Sa 23.10.04 11:04 
Hi Ben,
erstmal fettes Danke, dass du dich mit meinem Problem beschäftigst. :)

Also ich habe jetzt beide Varianten ausprobiert:
1. alles beim Start in den TreeView einfügen (ohne Umwege) => ~30sec
2. bei Bedarf 2 Ebenen laden (wegen der Anzeige der Unterschlüssel mit dem "+")
hier braucht das HKCR auch rund 20sec, obwohl ich BeginUpdate und EndUpdate nutze.


Mir kommt langsam der Verdacht, ich mache da was total falsch.
Normalerweise bin ich in solchen Sachen, wie Probleme lösen, gut, aber hier muss ich echt passen. :(

Hab jetzt nach stundenlangem Probieren meinen Algorithmus entfernt und versuche jetzt ne andere (bessere) Lösung zu finden.
Ich komme nur nicht drauf, wieso das so lange dauert :cry: , denn egal wie ich es mache, ich komme nicht annähernd an den Speed anderer Editoren ran. :(



MfG,
TheNeon :wave:
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 23.10.04 18:52 
Weiterher Tipp:
Nutzung von VirtualTreeView anstatt der VCL.
Die VCL ist dafür berüchtigt lahm zu sein :D

Weiterhin: Nicht jeden Key mit relativen Pfaden prüfen, sondern absolute Pfade nutzen.

Verwenden der Funktion HasSubkeys für direkte Zuweisung im TreeNode.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
TheNeon Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 408

Windows
VS2010 C#
BeitragVerfasst: So 24.10.04 00:33 
:flehan:
DANKE, BenBE

der letzte Tipp hats gebracht!!!
nun läuft es wie RegEdit :)


DANKE DANKE


Salut,
TheNeon