Re: Drawing speed in rev 2.8

2007-06-05 Thread James Hurley


Message: 4
Date: Mon, 04 Jun 2007 10:49:15 -0700
From: Scott Rossi <[EMAIL PROTECTED]>
Subject: Re: Drawing speed in rev 2.8
To: How to use Revolution 
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain;   charset="US-ASCII"

Recently, James Hurley wrote:


I've just moved over to 2.8 and have  found a significant loss of
speed in drawing with the  pencil tool.

Does anyone have any idea why the handler below would take 88 ticks
in 2.7, but 302 ticks in 2.8?


I see the same speed you describe in 2.8.1.  Not sure why there is a
difference compared to older versions, but the following could be a
workaround for you, plus allow you to somewhat control the speed at  
which

the drawing is completed.

[ between the NEW comments ]

on mouseUp
  put the ticks into tStartTime

  repeat while the number of images >0
delete image 1
  end repeat

  put the width of this card/2 into x0
  put the height of this card/2 into y0
  put 0 into  x
  put 0 into  y
  put  2 into tStep
  put 0 into tAng
  put pi/180 into radPerDeg
  choose the pencil tool
  -- BEGIN NEW
  put "" into tLocked

  repeat with tAng = 1 to 360
if tAng mod 8 <> 0 then -- HIGHER NUMBER = FASTER DRAW RATE
  if not tLocked then
lock screen
put true into tLocked
  end if
else
  unlock screen
  put false into tLocked
end if
-- END NEW
put tStep* cos(radPerDeg* tAng) into dx
put  tStep * sin(radPerDeg *  tAng) into dy
drag from round(x0+x),round(y0+y) to round(x0+x+dx), round(y0+y 
+dy)

add dx to x
add dy to y
  end repeat

  choose the browse tool
  put the ticks - tStartTime into msg box
end mouseUp

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design


Thanks Scott. You suggestion is very helpful in speeding up this  
particular handler.


Unfortunately the handler was only meant to be an illustration of a  
problem that occurs in a wide variety of routines using the pencil  
tool to draw with.


This four-fold drop in speed is a serious blow to my Turtle Graphics  
programs.


I will submit a request to bugzilla that the pencil tool be  
resuscitate in 2.8.


Thanks,

Jim Hurley
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Drawing speed in rev 2.8

2007-06-04 Thread Scott Rossi
Recently, James Hurley wrote:

> I've just moved over to 2.8 and have  found a significant loss of
> speed in drawing with the  pencil tool.
> 
> Does anyone have any idea why the handler below would take 88 ticks
> in 2.7, but 302 ticks in 2.8?

I see the same speed you describe in 2.8.1.  Not sure why there is a
difference compared to older versions, but the following could be a
workaround for you, plus allow you to somewhat control the speed at which
the drawing is completed.

[ between the NEW comments ]

on mouseUp
  put the ticks into tStartTime
  
  repeat while the number of images >0
delete image 1
  end repeat
  
  put the width of this card/2 into x0
  put the height of this card/2 into y0
  put 0 into  x
  put 0 into  y
  put  2 into tStep
  put 0 into tAng
  put pi/180 into radPerDeg
  choose the pencil tool
  -- BEGIN NEW
  put "" into tLocked
  
  repeat with tAng = 1 to 360
if tAng mod 8 <> 0 then -- HIGHER NUMBER = FASTER DRAW RATE
  if not tLocked then
lock screen
put true into tLocked
  end if
else
  unlock screen
  put false into tLocked
end if
-- END NEW
put tStep* cos(radPerDeg* tAng) into dx
put  tStep * sin(radPerDeg *  tAng) into dy
drag from round(x0+x),round(y0+y) to round(x0+x+dx), round(y0+y+dy)
add dx to x
add dy to y
  end repeat
  
  choose the browse tool
  put the ticks - tStartTime into msg box
end mouseUp

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: Drawing speed

2002-02-22 Thread Scott Raney

On Fri, 22 Feb 2002 Jim Hurley <[EMAIL PROTECTED]> wrote:
> Subject: Drawing speed
> Reply-To: [EMAIL PROTECTED]
> 
> 
> Jim Hurley wrote:
> 
> >  > > There appears to be no remedy in the offing to the speed problem.
> 
> Scott Rainey wrote:
> 
> >Actually the current release is pretty close to HC in performance,
> >the primary remaining difference being due to running in color vs
> >black and white (anywhere from 8 to 32 times as much data to move
> >around, you know).
> 
> I concede the difficulties in speedily running color vs. black and 
> white, and the improvement in the current release is much 
> appreciated. However there remains a considerable gap between MC/RR 
> and HC. For example, the following script draws concentric boxes of 
> ever decreasing size.
> 
> on mouseUp
>clean
>put 100 into a
>put  300 into b
>put 2 into da
>choose the line tool
>put the ticks into startTime
>repeat 50 --draw boxes of ever decreasing size
>  drag from a,a to b,a
>  drag from b,a to b,b
>  drag from b,b to a,b
>  drag from a,b to a,a
>  add da to a
>  subtract da from b
>end repeat
>put the ticks - startTime into field 1
>choose the browse tool
> end mouseUp
> 
> on clean
>repeat until the number of images = 0
>  delete image 1
>end repeat
> end clean
> 
> This script takes 265 ticks on average in RR and  30 ticks in HC on 
> cards of identical size.

Hmm, looks to be about a factor of 8, which is pretty good considering
there's about 32 times as much data being moved around (assuming
you're running in "millions" screen depth).  Further confirmation that
the limit is just with the data size is to increase (or decrease) the
size of the window or image: doubling it in width and height increases
the time by just about a factor of 4, demonstrating that all the time
is in moving the bits around.

> (I realize that this can be done more 
> efficiently with the rectangle tool and that a graphic would be 
> faster than an image. My  purpose was to measure the drag speed. ) 
> The discrepancy would be less in Windows.

Much less, actually.  I get 16 ticks on my 733MHz PIII.  We don't know
why masked image drawing is so slow on MacOS (hell, it's slow even
compared with UNIX/X11 which doesn't even *have* a masked image
drawing primitive and it has to be done with 3 separate operations
there), but unfortunately there's not a damned thing we can do about
it.

> There is no limit to the greedy demands which we, the  users, put on 
> Scott and the development team. In my case, to properly implement 
> Turtle Graphics, I hunger for a speedy monochromatic drawing  mode.

Unfortunately that's not the business we're in, and I doubt even that
would be a satisfactory solution to the problem even if we were (i.e.,
even the various Logo implementations all support color now).  But
this is the perfect situation in which to use an external.  You could
probably get 2 orders of magnitude better performance if you just drew
directly to the window instead of having everything buffered like
painting in HC and MC require.  You do lose the ability to overlay
images on buttons and fields, persistence, and the ability to edit the
bits you've previously drawn, but fortunately none of these things are
required for turtle graphics.  You might try M. Uli Kusterer's
([EMAIL PROTECTED]) xDraw package, for example, or ask him
if he has other suggestions for how best to do this.
  Regards,
Scott

> Jim Hurley


Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...



___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Drawing speed

2002-02-22 Thread Scott Rossi


On Friday, February 22, 2002, at 06:22  AM, Jim Hurley wrote:

> I concede the difficulties in speedily running color vs. black and 
> white, and the improvement in the current release is much appreciated. 
> However there remains a considerable gap between MC/RR and HC. For 
> example, the following script draws concentric boxes of ever decreasing 
> size.
>
> on mouseUp
>   clean
>   put 100 into a
>   put  300 into b
>   put 2 into da
>   choose the line tool
>   put the ticks into startTime
>   repeat 50 --draw boxes of ever decreasing size
> drag from a,a to b,a
> drag from b,a to b,b
> drag from b,b to a,b
> drag from a,b to a,a
> add da to a
> subtract da from b
>   end repeat
>   put the ticks - startTime into field 1
>   choose the browse tool
> end mouseUp
>
> on clean
>   repeat until the number of images = 0
> delete image 1
>   end repeat
> end clean
>
> This script takes 265 ticks on average in RR and  30 ticks in HC on 
> cards of identical size. (I realize that this can be done more 
> efficiently with the rectangle tool and that a graphic would be faster 
> than an image. My  purpose was to measure the drag speed. ) The 
> discrepancy would be less in Windows.

Since I'm fairly entrenched in graphics work, this post caught my eye.  
One thing you need to keep in mind with MC/REV is that usually, not 
always, but usually there are similar ways to achieve what you've done 
before using alternate methods.  For example, I ran the above script and 
timed a rough average of 111 ticks.  Then instead of choosing the line 
tool, I chose the pencil tool, and drawing time was reduced to 37 
ticks.  Adding a "lock screen" reduced the overall time to 9 ticks -- 
virtually immediate.


> In my case, to properly implement Turtle Graphics, I hunger for a 
> speedy monochromatic drawing  mode.

I seem to recall my experience in Turtle Graphics (around 20 years ago!) 
involving the creation of a list of points that the "Turtle" then 
rendered by dragging from point to point, with pen up and pen down 
instructions.  I would imagine the above mentioned pencil tool will 
achieve what you need with no time penalty.  And also you get the 
benefit of color (back in those days the only screen color was 
phosphorescent green...).

Hope this helps.

Regards,

Scott Rossi
Creative Director, Tactile Media
[EMAIL PROTECTED]
http://www.tactilemedia.com

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



RE: Drawing speed

2002-02-22 Thread Yates, Glen

Interesting little speed test, I get 102 ticks in MC on a 933MHz Pentium 3,
and 161 ticks on a 400MHz B&W G3 (with Retrospect running in the
background).

Try running in thousands of colors instead of millions, and you should see a
good speed increase from your 265 ticks.

-Glen Yates


Jim Hurley wrote:

>I concede the difficulties in speedily running color vs. black and 
>white, and the improvement in the current release is much 
>appreciated. However there remains a considerable gap between MC/RR 
>and HC. For example, the following script draws concentric boxes of 
>ever decreasing size.

<<>>

>This script takes 265 ticks on average in RR and  30 ticks in HC on 
>cards of identical size. (I realize that this can be done more 
>efficiently with the rectangle tool and that a graphic would be 
>faster than an image. My  purpose was to measure the drag speed. ) 
>The discrepancy would be less in Windows.

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution