REBOL3 tracker
  0.9.11 beta
Ticket #0001624 User: anonymous

Project:

Previous Next
TypeWish Statusbuilt Date24-Jun-2010 08:27
Versionalpha 99 CategoryMezzanine Submitted byLadislav
PlatformAll Severityminor Prioritynormal

Summary Optimize AS-PAIR function
Description The AS-PAIR function as implemented now is most probably the fastest way how to implement this function in R2. My measurements show, that the AS-PAIR-2 function below is faster in R3, though.
Example code
as-pair-2: make function! [[
    "Combine X and Y values into a pair."
    x [number!] y [number!]
	/local z
][
	z: 0x0
	z/x: x
	z/y: y
	z
]]

>> time-block [as-pair 0 0] 0,05
== 9.9945068359375e-7

>> time-block [as-pair-2 0 0] 0,05
== 7.82012939453125e-7

Assigned ton/a Fixed inalpha 102 Last Update21-Jul-2010 22:08


Comments
(0002454)
Carl
21-Jul-2010 22:02

Speed of AS-PAIR can be important for graphics.

Therefore, it's now native.

Note: no range checks are performed because pairs are now floats. If we think range checking is "critical" then we can discuss how to add it at a high cost of performance. (For range errors never likely to occur, IMO.)

Date User Field Action Change
21-Jul-2010 22:08 carl Fixedin Modified => alpha 102
21-Jul-2010 22:02 carl Comment : 0002454 Modified -
21-Jul-2010 22:02 carl Comment : 0002454 Added -
21-Jul-2010 21:59 carl Status Modified reviewed => built
26-Jun-2010 04:53 BrianH Summary Modified AS-PAIR function => Optimize AS-PAIR function
26-Jun-2010 04:53 BrianH Code Modified -
26-Jun-2010 04:53 BrianH Category Modified Unspecified => Mezzanine
26-Jun-2010 04:53 BrianH Status Modified submitted => reviewed
26-Jun-2010 04:53 BrianH Type Modified Note => Wish
24-Jun-2010 08:27 Ladislav Ticket Added -