LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sort cluster efficiency

Nice "orthogonal"-thinking, Ben! Smiley Happy
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 21 of 26
(1,170 Views)

Hello Everybody,

my work day is finished i am back online.

let me first applaud all the posts about my problem. i will, first thing in the morning post tomorow the vi itself ( at home i only have LV7.1, the vi is in 8.2 at office). will also clean it up as asked so much.

computer efficiency: i have a normal P4 2GHz with about 2GB ram and other stuff. running windows xp sp2.

about the efficency of the sort: as pointed out already, if one takes a few mega elements in an array, sort is reaching very fast the few seconds, nothing to do about that. in my particular VI, the whole v-Vi without sort takes 600ms, for the array size i have. and the sort itself take about 3000ms.

the fact that it is a cluster rather than an array doesnt take appreciably more computation time. the way i do it specifically here is just indexing the first element an sorting, hoping that then the sort would be only according to this element and not to the whole cluster, therefore saving computer time. (this is a nice tric by Altenbach by the way, in a thread i found from about a year ago)

as pointed out already, this of course takes more memory and a bit more calculation time by itself. and not surprisingly, the overal sort process now takes exactly the same 3000ms (plus minus a few...).

i am now exploring other options like simply NOT sort, but rather merge some previously sorted arrays (in the mother vi) and othe little trics together.

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 22 of 26
(1,162 Views)
Hei
 
here are the vi's. bear in mind this is an old version of it.
 
i'll post later on also my home-brewed sort solutions (which are of course also much slower...)
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 23 of 26
(1,140 Views)
Hi Gabi,

could you indicate what settings we have to do?
Maybe save the VI with the settings needed?

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 24 of 26
(1,135 Views)
@tbd wrote:

@smercurio_fc wrote:
You know, I still haven't heard anyone refute that 3 seconds is not that unreasonable when sorting an array of clusters of over 2 million elements that takes up, as the posted indicated, over 100 MB, regardless of what the poster might believe. Gabi never indicated what kind of machine they're using, or what else is going on in terms of other processes. I wonder if we're just splitting hairs here...


Hi Smercurio, your point is well taken - but since Gabi's interest was having this run faster, why not see whether a 2X or 10X improvement is possible?

I have no issue with looking at trying to improve an algorithm, regardless of what that algortihm is. My point was that Gabi's original post, and subsequent comments, basically said that he found it increduous that it would take a computer "3 seconds!!" or "3000 msec!!!" (exclamation points quoted as posted) to sort an array of clusters of over 2 million elements hovering at about 100 MB. As I indicated, using the stock Sort 1D array on my 3GHz P4 I got 2.7 secs. I simply don't find this result that hard to believe. It's one thing to say, "hey, is it possible to improve this". It's another to say that it's simply not possible to believe that it would take this long, implying there must be something inherently wrong with the Sort 1D Array function.

I just think Gabi needs to put this result into perspective considering what he's trying to do. 3 seconds for what he's doing is not unreasonable. Can it be improved? Probably. Is it worth the effort? Debatable, as it seems to be more of an exercise of "hmmm.. I wonder if there's a faster way to do this..." as opposed to "this is absolutely impossible, what is the matter with this thing?".

That's all that I'm trying to say. My comment regarding splitting hairs was more directed to the incredulity that Gabi was bringing forth, and I certainly could have found a better way of saying it. I think the ideas being brought forth here about alternative solutions are quite interesting and indicative of the breath of the ingenuity of the LabVIEW community in tackling a subject.


Message 25 of 26
(1,124 Views)
Hei Smercurio,
 
you are right i cant expect sort to be much faster. the thing is that it took me some time to understand that this was the time taking element. i found it a surprise when i do so much computation in my project, that this little thing take most of the time.
i have solved my problem by  NOT sorting Smiley Happy
 
 
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
Message 26 of 26
(1,103 Views)