No such thing as a small change | |
PerlMonks |
Re^5: PDL: Looking for efficient way to extract sub-images, by finding bounding boxes of "objects" (7000x faster)by BrowserUk (Patriarch) |
on Nov 21, 2016 at 13:44 UTC ( [id://1176248]=note: print w/replies, xml ) | Need Help?? |
Curiouser and curiouser! When I run the code under 5.10, I get the sort of timings I posted above:
But if I run it under 5.22, your sub runs very much faster* and buk3() doesn't terminate at all: which is weird and indicates (IMO) a bug in the later versions(*I have an idea about the cause of the slowness in 5.10; I'll need to think of a way to verify it.) Modifying buk3() along the lines of your modification, but taking an lvalue ref outside the while loop and using it within the loop, allows it to work again:
Which is okay, but a strange difference. It kinda takes the steam out of my amazing speedup figures -- 15x instead of 7000x -- but the thrill is transitory anyway :) And now I can run your sub on a larger image, even that gain is far less:
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|