in reply to Re^3: Process large text data in array
in thread Process large text data in array
Exactly as it is written, yes it is slower and I expect it to be slower. The model is sound, as I use it in other applications that are actually CPU bound and it does provide a scalable performance improvement
Testing it just now, I get 0.9s run time on a 24MB input file for the single threaded code. I get 6.5s run time on the same input using the multi-threaded code, so massively worse performance, as expected.
When I increase the number of filters to 83 and skew the ordering to match towards the end (to simulate a CPU bound process), I get 5.8s run time for the same input for the single threaded code. I get 6.1s run time for the multi-threaded code. An admittedly more realistic scenario would be either randomly matching across the full range of filters, or to long tail the matching, with the majority skewed to the front, depending on how much effort has been made by OP to enhance performance, but I'm not sure how much effort I want to put into this right now :-)
Given the performance figures OP was quoting, I made the assumption that the process is CPU bound in their case, in which case (as my figures above indicate), a multi-threaded approach can definitely assist and is certainly worth exploring.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Process large text data in array
by BrowserUk (Patriarch) on Mar 11, 2015 at 17:24 UTC | |
by SimonPratt (Friar) on Mar 11, 2015 at 18:12 UTC |