RE: No built-in swap function?

Discussion in 'Python' started by Simon Wittber, Apr 21, 2004.

  1. >That's 6 LOAD_FAST, and 3 STORE_FAST operations, plus XOR'ing.

    NB. I do not fully understand how psyco works.

    The point I was trying to make, is that I expected a psyco optimised xor
    swap to optimise down to ~3 CPU instructions, much like my old C
    compiler once did.

    AFAIK, psyco generates machine code, not python byte code?

    Sw.
     
    Simon Wittber, Apr 21, 2004
    #1
    1. Advertising

  2. Simon Wittber

    David Fraser Guest

    Simon Wittber wrote:
    >>That's 6 LOAD_FAST, and 3 STORE_FAST operations, plus XOR'ing.

    >
    >
    > NB. I do not fully understand how psyco works.
    >
    > The point I was trying to make, is that I expected a psyco optimised xor
    > swap to optimise down to ~3 CPU instructions, much like my old C
    > compiler once did.
    >
    > AFAIK, psyco generates machine code, not python byte code?
    >
    > Sw.
    >
    >

    Yes, psyco generates machine code. But why not ask this on the psyco
    mailing list? Armin is very responsive

    David
     
    David Fraser, Apr 21, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. OSHIMA

    swap() function without tmp

    OSHIMA, May 14, 2004, in forum: C Programming
    Replies:
    30
    Views:
    1,272
    Dan Pop
    May 21, 2004
  2. Simon Wittber

    RE: No built-in swap function?

    Simon Wittber, Apr 21, 2004, in forum: Python
    Replies:
    2
    Views:
    331
    Josiah Carlson
    Apr 21, 2004
  3. Replies:
    2
    Views:
    283
  4. Niels Dekker (no reply address)

    What swap is called when using std::swap?

    Niels Dekker (no reply address), Jul 19, 2006, in forum: C++
    Replies:
    4
    Views:
    1,011
    Niels Dekker (no reply address)
    Jul 20, 2006
  5. Jess
    Replies:
    28
    Views:
    773
    Daniel T.
    Jun 18, 2007
Loading...

Share This Page