LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from XML performance issues

My best proposal:

Create a bunch of multiple XML files rather than a single monolithical one. This will simplify handling of file(s) by a great deal as long as filenames are distinctive but can be built automatically in a simple way.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 11 of 19
(729 Views)

P@Anand wrote:

I tried with 7 MB file and for that it took ~68 seconds to load and I can see how long it will take to load a file of around 200MB. How did you arrive at the Array of cluster? Is the other application you meant is also on LabVIEW platform?. I am not experienced with XML but trying what I can do.


The output from the XML file read is an array of clusters I then unbundle the elements I need from this cluster array format them inot seperate strings then rebuild the array and place them into a table

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 12 of 19
(727 Views)

That XML parsing is silly slow, luckily you dont need it! 🙂

XML cluster.png

That takes ~2 secs on my computer. You could half your old time by just using 1 of the XML parsers, they gave the same answer.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 13 of 19
(721 Views)

I remember having xml performance issues in an old project, it seems the constant allocation by shuffling "after match" is very expensive. I think it's alot faster if you shuffle the "index after match" instead. It seems to be a horrible implementation of NI anyhow.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 14 of 19
(717 Views)

@Yamaeda wrote:

That XML parsing is silly slow, luckily you dont need it! 🙂

 

That takes ~2 secs on my computer. You could half your old time by just using 1 of the XML parsers, they gave the same answer.

/Y


You are too smart to find a way out of the box. Kudos 🙂

-----

The best solution is the one you find it by yourself
Message 15 of 19
(702 Views)

The problem isn't with LabVIEW per se.  its a limitation of the Document Object Model  The XML Parser vis rely on the standard parser (DOMUserDefRef.dll) that all your browsers use. and loading the xml file like that can get nasty since DOMUserDefRef isn't thread safe so it runs in the UI Thread.  A Defer Panel Updates would help but is not a fix for files this size.

 

Luckilly the file follows the LabVIEW XML Schema Which supports only what LabVIEW data types exist.  So using Unflatten XML String can work VERY fast but it limits what applications can share the data to the subset of those that can understand the LabVIEW schema.


"Should be" isn't "Is" -Jay
0 Kudos
Message 16 of 19
(684 Views)

@JÞB wrote:

The problem isn't with LabVIEW per se.  its a limitation of the Document Object Model  The XML Parser vis rely on the standard parser (DOMUserDefRef.dll) that all your browsers use. and loading the xml file like that can get nasty since DOMUserDefRef isn't thread safe so it runs in the UI Thread.  A Defer Panel Updates would help but is not a fix for files this size.

 

Luckilly the file follows the LabVIEW XML Schema Which supports only what LabVIEW data types exist.  So using Unflatten XML String can work VERY fast but it limits what applications can share the data to the subset of those that can understand the LabVIEW schema.


Actually the Read from XML only seems to use extensive use of regular expression nodes, no DLL.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 17 of 19
(673 Views)

XML Parser vis. /Y

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 18 of 19
(667 Views)

Are we talking about the same VI's? In OP's vi he uses ReadFromXMLString with the following hierarchy:

ReadXMLHierarchy.png

 

No DLLs 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 19 of 19
(646 Views)