peach vs each

Hello,
I have 2 functions f1 and f2. Why is ‘peach’ slower than ‘each’ in f2?

q)\s

8i

q)f1:{do[100000;x+x]}

q)f2:{do[100000;x+2]}

q)\t f1 each til 8

218

q)\t f1 peach til 8

27

q)\t f2 each til 8

165

q)\t f2 peach til 8

307

(It seems having constants in the do loop makes ‘peach’ slower)

Thanks in advance.

Hi,

On mine it works as expected. Perhaps some of your cores were busy doing
other work. Try repeating it a few time while making sure nothing else
is running.

q)q)f1:{do[100000;x+x]}
q)q)f2:{do[100000;x+2]}
q)\t f1 each til 8
114
q)\t f1 peach til 8
45
q)\t f2 each til 8
148
q)\t f2 peach til 8
73
q)\s
8i
q).z.k
2012.11.13
q).z.K
3f

On 1/3/2013 12:37 PM, Jinming Shao wrote:
> Hello,
> I have 2 functions f1 and f2. Why is ‘peach’ slower than ‘each’ in f2?
>
> q)\s
> 8i
> q)f1:{do[100000;x+x]}
> q)f2:{do[100000;x+2]}
> q)\t f1 each til 8
> 218
> q)\t f1 peach til 8
> 27
> q)\t f2 each til 8
> 165
> q)\t f2 peach til 8
> 307
>
> (It seems having constants in the do loop makes ‘peach’ slower)
>
> Thanks in advance.
> –
> You received this message because you are subscribed to the Google
> Groups “Kdb+ Personal Developers” group.
> To post to this group, send email to personal-kdbplus@googlegroups.com.
> To unsubscribe from this group, send email to
> personal-kdbplus+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/personal-kdbplus?hl=en.

I tried it several times, ‘peach’ is constantly slower than ‘each’ for f2.
Noticed my version is older than yours:

q).z.k

2012.05.29

q).z.K

3f