REBOL3 tracker
  0.9.12 beta
Ticket #0001624 User: anonymous

Project:

Previous Next
rss
TypeWish Statuscomplete 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 108 Last Update3-Nov-2010 18:44


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.)
(0002536)
BrianH
23-Sep-2010 10:06

In a107 the function is still mezzanine. I suspect that the mezzanine is still defined and overwriting the native.
(0002538)
Carl
24-Sep-2010 00:03

Awesome guess. Fixed in A108.
(0002776)
Ladislav
3-Nov-2010 18:13

in the core-tests suite
(0002777)
Ladislav
3-Nov-2010 18:44

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

Date User Field Action Change
3-Nov-2010 18:44 Ladislav Comment : 0002777 Added -
3-Nov-2010 18:42 Ladislav Status Modified tested => complete
3-Nov-2010 18:13 Ladislav Comment : 0002776 Added -
20-Oct-2010 03:53 BrianH Status Modified built => tested
24-Sep-2010 00:03 carl Comment : 0002538 Added -
24-Sep-2010 00:02 carl Status Modified problem => built
24-Sep-2010 00:02 carl Fixedin Modified alpha 102 => alpha 108
23-Sep-2010 10:06 BrianH Status Modified built => problem
23-Sep-2010 10:06 BrianH Comment : 0002536 Added -
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 Type Modified Note => Wish
26-Jun-2010 04:53 BrianH Status Modified submitted => reviewed
26-Jun-2010 04:53 BrianH Category Modified Unspecified => Mezzanine
26-Jun-2010 04:53 BrianH Code Modified -
26-Jun-2010 04:53 BrianH Summary Modified AS-PAIR function => Optimize AS-PAIR function
24-Jun-2010 08:27 Ladislav Ticket Added -