Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/22/2023 in all areas

  1. Okay as with most things, there is some nuance. If the number of elements being deleted are very small, the OpenG method is faster, but it has to be pretty small, and the main array you are deleting from needs to be pretty large. Attached is the version that I think works well, and supports sorted, or unsorted indexes to delete with the same output as the OpenG method, which includes the deleted elements. Methods of deleting multiple array elements Hooovahh Test.vi
    1 point
  2. Hey that's a pretty cool speed test. Even if you turn down the samples to something more reasonable like 100, or 1000 the OpenG method still loses by an order of magnitude. Would you mind if I adapted your code into the Hooovahh Array VIMs package? At the moment it is basically the OpenG method, with an optional input on if the indexes to remove are sorted already or not. The OpenG method returns the deleted elements, and there is a some book keeping that needs to take place if that array isn't sorted. But if your method works the way I think it's performance with or without sorted indexes should be similar. Also if anyone sees performance improvements for that array package I'd be interested in adding them. Most of it is the OpenG methods, with a few changes to help performance. EDIT: Oh the OpenG method does work with unsorted elements to remove, and returns the deleted elements in the correct order. I think the Shift and subarray, still can generate the same output, but needs extra work to track things which might eat into that time difference.
    1 point
  3. This is an interesting feature that I guess is one of the mechanisms for clustering. It's basically like an HTTP redirect but I'm not sure how I'm going to handle it ATM. CONNACK is fine but a disconnect is usually the end of the conversation with an error 66. Interesting that they don't mention a redirect depth.
    1 point
  4. You cannot. The costly method (more so the larger the array and the number of deletes are) is to do repeated deletes (decrementing delete indexes as you go if you do it in order e.g., see attached example code). It is costly in both memory and speed due to reallocation on every round. (The same goes for array building; do not do it one element/subarray at a time, pre-allocate the full size then replace (or use auto-indexing in for loop to have LabVIEW pre-allocate automatically)). For multiple deletes nowadays I suspect conditional array indexing will most often be the most (or at least quite) efficient way to handle it. Something like this (NOTE this particular example assumes sorted (and non-empty) delete indexes!): If the evaluation of which elements to delete can be done within the loop the logic gets simpler... Doing a quick test on my computer, comparing it with deletes of half the elements in an array of 100k elements (extreme case), this cuts the time of the operation from a whopping 3 seconds to 0,4 ms (OpenG does multiple deletes from the end instead of start, that is only marginally better (1,5 sec) than deletes from the start (3 sec), as you can see in the example code). Before effective conditional indexing in for-loops was added to LabVIEW a more efficient algorithm (still, but only very slightly) would involve shifting array elements (using replace, which is very fast and does not allocate) we want to keep to the front, then taking the subarray with the new size in one operation. I have added that to the attached example. Methods of deleting multiple array elements.vi
    1 point
  5. Try this. Windows User Login 2017.zip
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.