in reply to Re^2: Computing Subsets
in thread Computing Subsets
Thank you, Dave, for seeing the (inadvertently placed and) disruptive say in the sub wrapper. I didn't mean for it to be in there, and it certainly would throw off the results. It's been a long day here...
Yes, the results do change with a larger data set and a better hash algorithm:
Rate isSubset isSubsetSmarter isSubsetHash isSubset 59189/s -- -48% -54% isSubsetSmarter 112912/s 91% -- -13% isSubsetHash 129049/s 118% 14% --
Interestingly, if I change do { $count-- when @big } for @small; to do { $count-- if $_ ~~ @big } for @small; in isSubsetSmarter, the following results are produced:
Rate isSubset isSubsetSmarter isSubsetHash isSubset 59390/s -- -50% -54% isSubsetSmarter 118219/s 99% -- -9% isSubsetHash 129268/s 118% 9% --
It becomes apparent now, however, that using a hash for larger data sets in these cases improves performance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Computing Subsets
by davido (Cardinal) on May 28, 2012 at 06:56 UTC |