My champion so far is ]y
(1*m) %~ 1.485e9 * 6!:2 'm$0' [ m=: 1e7
2.3605
(4*#x) %~ 1.45e9 * 6!:2 'x+y'
2.68411
(4*#x) %~ 1.45e9 * 6!:2 ']y'
0.000273429
Note to callibrate the rate, I have to use
g=1.485e9 or so on P4 2.8GHz.
--- Roger Hui <[EMAIL PROTECTED]> wrote:
> Let f be a function that depends on every byte of
> its argument(s). >:y and x+y are examples of
> such a function, and {.y is not. The number of
> cycles per byte (CPB) for f is
> n %~ g * 6!:2 ' f y'
> n %~ g * 6!:2 'x f y'
> where n is the number of bytes in dense x, y,
> or the result x f y, whichever is the greatest;
> and g is the clock rate of the CPU.
>
> For example, on an ordinary (not overclocked)
> 2.2 Ghz AMD 3200+ machine,
>
> (1*m) %~ 2.2e9 * 6!:2 'm$0' [ m=: 1e7
> 2.34726
> (4*m) %~ 2.2e9 * 6!:2 'm$2' [ m=: 1e7
> 2.3531
> (8*m) %~ 2.2e9 * 6!:2 'm$0.2' [ m=: 1e7
> 2.35242
>
> The CPB for $ is approximately 2.35.
>
> Some others:
>
> x=: 1e7 [EMAIL PROTECTED] 2
> y=: 1e7 [EMAIL PROTECTED] 2
> (#x) %~ 2.2e9 * 6!:2 'x+.y'
> 4.85849
> (4*#x) %~ 2.2e9 * 6!:2 'x+y'
> 2.69899
> (4*#x) %~ 2.2e9 * 6!:2 '/:x'
> 6.04693
> (#x) %~ 2.2e9 * 6!:2 '/:~x'
> 3.09869
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm