LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting from large array too slow

Solved!
Go to solution

Maybe, but I see some serious errors in your code:

-Deal with I32 instead of Singles

-Delete 4 elements instead of 1

 

To speed up my example we could just output the data into a tunnel and let it autoindex into a 2D array and use Reshape Array.

 

Ton

 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 11 of 16
(872 Views)

TCPlomp wrote:

I see some serious errors in your code:


It's not my code.

Nevertheless i think the solution is your first post.

Everything else will cost a few seconds

0 Kudos
Message 12 of 16
(860 Views)

I agree, supposed solutions are to slow. I'll need to make patch to fix previus version of software and edit all of files record.

 

Thanks to all of you who helped.

0 Kudos
Message 13 of 16
(855 Views)

You can give Kudos to this idea, to help improve LabVIEW,

 

0 Kudos
Message 14 of 16
(824 Views)

I don't have to to code up and bench mark but...

 

I suspect most of the time would be associated with copying buffers and reallocating etc. , so...

 

1) Put the original array in a SR in a For loop.

2) Inside the For loop, use the Delete from the SR and pt the result back in the SR.

3) Delete the segments/blocks started at the max index and work toward the min index (this way you don't have to re-calcualte your index everytime you delete something).

 

If that does not do it, I'd try the inplace operations to slide down all the stuff I want to keep and after teh inplace work is done re-size the array.

 

Just tossing out other ideas,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 15 of 16
(816 Views)
Solution
Accepted by _thomas

I figure the most time is spend in reading the actual data from disk.

If I was _thomas I woud write a batch converter (based on my last code post) that removes all the length info bytes and store these to disk, run this overnight.

And adjust the actual code that currently writes the data to disk.

 

No need anymore to delete that info.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 16 of 16
(798 Views)