• Welcome to Theos PowerBasic Museum 2017.

ForEach

Started by Edwin Knoppert, June 29, 2009, 01:39:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Edwin Knoppert

I have this 7.5MB xml file and has a node having 24161 child nodes.
I obtain the nodelist and have two choices, use Item() with index to obtain the item and it's value.
The 2nd is using the enum method.
Both result in the same 30 seconds to read all nodes.

is item() already optimized?
i never thought that was correct and one had to use the ienumerator for fastest results.

I am using a dispatch object for the nodes but i wrote an interface for the enumerator (invoke, -4 etc..).
This enum. obtains a variant for the interface and i make it a dispatch variable.

Suggestions?

Edwin Knoppert

A simple loop does not eat time:

---------------------------
PowerBASIC
---------------------------
24161, .062
---------------------------
OK   
---------------------------

When i add this line:
Object Get oNode.Text To vText
It will take 20 seconds.

Edwin Knoppert

I just used an interface for node and does not increase reading speed.