Hi Yichao,

On 27 June 2014 12:17, Yichao Yu <[email protected]> wrote:
> I am still creating a tuple out of these 5 numbers/strings since I
> don't want to duplicate the hash functions for all of them. Can the
> compiler deal with this case efficiently?

If by "deal with this case efficiently" you mean, will the compiler
remove the tuple allocation and inline the 5-elements hash, then it
might just be possible depending on a number of details, but I doubt
it.  Better to be explicit.  I had in mind something like:

    my_hash = num1 * 1000003
    my_hash = (my_hash ^ num2) * 1000003
    my_hash = (my_hash ^ compute_hash(string3))
    my_hash = intmask(my_hash)   # at the end


A bientôt,

Armin.
_______________________________________________
pypy-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to