nice, Roger and Oleg... thank you.

Is the way to find all of the expressions with special code to just scan the 
release contents for compound expressions with "improved" next to them?

If no one has built a library, that baptises these expressions with shorthand 
names, I will go ahead and start one, and let the community suggest better 
names if mine are too poor.  If this has been done, I can try to update it.  
Maintaining a file is going to be the best way for the world to know the faster 
implementations.
intdiv =: <[EMAIL PROTECTED]

For isntance, I'm guessing that <. x % 512 would have no optimizations in 6.02


----- Original Message ----
From: Roger Hui <[EMAIL PROTECTED]>
To: Programming forum <[email protected]>
Sent: Friday, October 20, 2006 5:27:23 PM
Subject: Re: [Jprogramming] Interger division, the faster one

Preliminary benchmarks:

ts=: 6!:2 , 7!:[EMAIL PROTECTED]
x=: 1e6 [EMAIL PROTECTED] 2e6
ts 'Expression'

Expression          J6.02x              J6.01            Factor
x <[EMAIL PROTECTED] 512   0.0054822 4.19507e6  0.136416 2.09723e7   23.80 5.00
x <[EMAIL PROTECTED] 17    0.0213073 4.19507e6  0.154837 2.09723e7    7.27 5.00



----- Original Message -----
From: Roger Hui <[EMAIL PROTECTED]>
Date: Friday, October 20, 2006 8:24 am
Subject: Re: [Jprogramming] Interger division, the faster one

> That is a good idea.  The improvement should be 
> around a factor of 10 in time and a factor of 2
> in space.
> 
> 
> 
> ----- Original Message -----
> From: Oleg Kobchenko <[EMAIL PROTECTED]>
> Date: Friday, October 20, 2006 1:03 am
> Subject: [Jprogramming] Interger division, the faster one
> 
> > I expected there'd be special code for (<[EMAIL PROTECTED]). Alas,
> > 
> >   6!:2 '(i.1e6) % 256'
> > 0.0246238
> >   6!:2 '(i.1e6) <[EMAIL PROTECTED] 256'
> > 0.208256
> >   6!:2 '(i.1e6) <.@:% 256'
> > 0.236405
> > 
> > For powers of 2 there's still
> > 
> >   6!:2 '_8 (33 b.) (i.1e6)'
> > 0.0162501
> >   ((i.1e6) <[EMAIL PROTECTED] 256) -: _8 (33 b.) (i.1e6)
> > 1
> > 
> > 
> > Viewmat improvement
> > ~~~~~~~~~~~~~~~~~~~
> > 
> > Thus this change makes complex viewmat ~x3.5 faster.
> > 
> > k=. <.256*x - <. x      NB. both times
> > ...
> > mat=. _8(33 b.) (t *"2 k) + b (*"2) 256-k
> > ...
> > mat=. _8(33 b.) (t * k) + b * 256-k
> > ...
> > mat=. 256 #. mat


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm





----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to