[mercury-users] version_array vs. field update performance

Ondrej Bojar bojar at csse.unimelb.edu.au
Tue Feb 6 17:33:39 AEDT 2007


Hi,

I'm working with many vectors of floats, all of a fixed length. I create 
lots of them, then stepwise set and update some of the fields and sort 
them according to a scalar product with a constant "weights" vector.

Currently I use version_array to store each vector.

About 7% of run time is used on 'version_array.elem :=', and another 6% 
is used on 'version_array.elem'.

Given that the vector length is fixed, I could use tuples or data terms 
with field access functions to get or update vector components.

In a small test, I tried to compared the performance of each of the 
representations and I was surprised to see that there is nearly no speed 
difference observable. Would this be what you expect? I was hoping to 
see there is less overhead in the field update routines.

Can arrays (with the di/uo workaround hassle) be faster?

Or should I be just satisfied with the 7million field updates per second 
I get on my Intel(R) Pentium(R) M processor 1500MHz?

Thanks, Ondrej.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list