Jump to content

Recommended Posts

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Silvercloak

    6

  • MSasu

    5

  • irneb

    4

  • David Bethel

    3

Top Posters In This Topic

Posted
Nice explanation Irne :thumbsup:

Thanks Lee, nice alternatives. Though "logically" :lol: ... the one I've shown "should" be more efficient, since it uses only 4 function calls internally. Those you've shown uses 5, 5 & 7 respectively. I think we have discussed this previously, and come to the conclusion that practically there's not much in it - the differences are minute.

Benchmarking ...................Elapsed milliseconds / relative speed for 65536 iteration(s):

   (XOR nil nil)......1435 / 1.04 <fastest>
   (XOR1 nil nil).....1435 / 1.04
   (XOR3 nil nil).....1466 / 1.02
   (XOR3 T nil).......1466 / 1.02
   (XOR nil T)........1466 / 1.02
   (XOR2 nil T).......1466 / 1.02
   (XOR2 nil nil).....1467 / 1.02
   (XOR2 T T).........1467 / 1.02
   (XOR T nil)........1482 / 1.01
   (XOR1 T nil).......1482 / 1.01
   (XOR2 T nil).......1482 / 1.01
   (XOR1 nil T).......1482 / 1.01
   (XOR T T)..........1482 / 1.01
   (XOR3 nil T).......1498 / 1
   (XOR1 T T).........1498 / 1
   (XOR3 nil T).......1498 / 1 <slowest>

I've renamed yours to xor1, -2, & -3.

 

As you see, the one I gave tends to be faster. But only fractionally (seems to be under 1%), the actual values seem to have a greater impact.

Posted

Oh of course, mine aren't too readable either - I was just having fun with it :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...