[m-dev.] Version arrays

Simon Taylor stayl at cs.mu.OZ.AU
Fri Jan 23 16:48:14 AEDT 2004


On 23-Jan-2004, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Fergus Henderson, Thursday, 22 January 2004:
> > 
> > So the test was using arrays or maps with 100,000 elements?
> > 100,000 is a rather large collection size.
> > How does it compare with a collection size of 100, or 1000?
> > 
> > If you can get any speedup at all with collection sizes like that,
> > then the next experiment to try is replacing the pred_table map
> > (and perhaps others similar data structures) in the module_info with
> > version arrays.
> 
> Here is a more comprehensive set of results.  The first set of tests is
> for repeated reversals of an array of ints, the second set is for
> repeated summations of an array of ints.  Version arrays do better than
> maps once 100 items or thereabouts are involved.
> 
> benchmark: 1 reversals of 100000 items
> bt_array time:        810ms
> map array time:       660ms  ratio: 1.23
> version array time:   230ms  ratio: 2.86
> ordinary array time:  100ms  ratio: 2.29

You're not doing nearly enough iterations.  To be a useful benchmark,
I'd suggest trying to get a runtime of at least a minute.

Simon.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list