Re: Timing (was wordOffset, repeat loop, speed?

2003-01-06 Thread Dar Scott

On Monday, January 6, 2003, at 07:54 AM, Glasgow, David wrote:


It may be that things have moved along a bit, or I am getting 
something wrong I'd be interested in any comments.

Computers and timers are a lot more accurate.

It is true that interrupts and system threads are running all the time 
and the time you measure will often be higher than what you want to 
look at (in some sense).

If you are timing a one second operation you _will_ be including some 
system overhead in measurement.  The precision timing may not mean much 
here.  If you take lots of measurements and average those you will have 
the effective time in that environment, hardware and OS.

If you are measuring very short times you need the precision.  In this 
case, you can average.  Make sure you throw out the outliers.  Or you 
can take the minimum of several time trials.  This tends to remove the 
effect of the OS, so you cannot compare to the times from the longer 
time method above.  This does allow you to make some decisions in 
coding style.

The minimum method may provide a useful measure for long periods also, 
depending on your use, but it will always include some system overhead 
time.

In my method for measuring short times, I use the same command for 
getting the time before and after the operation to be measured.  I also 
use that for measuring doing nothing, effectively measuring the time to 
make a measurement.  I subtract that from my results.

Dar Scott



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


Re: Timing (was wordOffset, repeat loop, speed?

2003-01-06 Thread Mark Brownell
Hi,

Three questions below.

Code that works for me; ten-line-limit for testing at this point:

-- button #1
global gData, tStart, tElementNum
on mouseUp
  put the milliseconds into tStartTime
  put the text of field impfield into gData
  put (the milliseconds - tStartTime)   milliseconds into field say
  put 0 into tStart
  put 1 into tElementNum
end mouseUp

-- button #2
global gWordArray, gData, tStart, tElementNum
on mouseUP
  put  into field say
  ask enter a word to check
  set the wholeMatches to false
  put the milliseconds into tStartTime
repeat with x = 1 to 500
  put wordOffset(it,gData,tStart) into tNum
  put (tNum + tStart) into tStart
  if tNum  1 then exit repeat
  put tStart into gWordArray[tElementNum]
  add 1 to tElementNum
end repeat
  put (the milliseconds - tStartTime)  it  tElementNum  tStart  cr
into field say
end mouseUp

-- button #3
global gWordArray
on mouseUp
  put the milliseconds into tStartTime
  put keys(gWordArray) into keyWordsList
  put return after field say
  repeat for each line l in keyWordsList
put l  tab  gWordArray[l]  return after displayResult
  end repeat
  put (the milliseconds - tStartTime) after field say
  put displayResult after  field say
end mouseUp

1.) This seems a little slow. It took 2.7 seconds to do (button #2) with 400
kbytes of text  209 possible hits for a single word.

2.) I noticed that it won't work with multiple words or empty space between
characters. I would like to work with the numericle offset of characters and
place that info gathered into an array if possible.

3.) I have an off-topic question about a single user pro-license. If I get
that version does it mean that I can use it on Mac  Windows to debug on
those OS, or will I need to get a license for each OS that I wish to
develope on? The documents were not clear enough for a carpenter regarding
this. So I'm asking here.

Thanks,
Mark Brownell
Gizmotron Graphics

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



Re: Timing (was wordOffset, repeat loop, speed?

2003-01-06 Thread Dar Scott

On Monday, January 6, 2003, at 11:58 AM, Mark Brownell wrote:


2.) I noticed that it won't work with multiple words or empty space 
between
characters. I would like to work with the numericle offset of 
characters and
place that info gathered into an array if possible.

Would offset() do what you want?
I would expect this to be faster, since going to the start position 
will have constant time.

(Your method probably has mc^2 time, call it E ;-), where m is the 
number of words to find and c is the length of your string in 
characters.  Using offset() should have mc time.  Why squared?  I'm 
just guessing, but I assume wordOffset() has to count up to the 
starting word each time.)

Dar Scott

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


Re: Timing (was wordOffset, repeat loop, speed?

2003-01-06 Thread Dar Scott

On Monday, January 6, 2003, at 12:24 PM, Dar Scott wrote:


(Your method probably has mc^2 time, call it E ;-),


I think got this wrong.  When I saw the mc^2 pun, my brain turned off.  
In any case, my guess is that offset will be faster.

Dar Scott

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


Re: Timing (was wordOffset, repeat loop, speed?

2003-01-06 Thread Mark Brownell
Wow!
63 milliseconds; 206 hits; 390345 characters ...looks like I have a  very
fast parser. It even works well with empty space, it gives me exactly what I
needed. The array contains all first character numerical valuse for each
hit.

So what about multiple OS uses for the licensed person of the single pro
version license? -- anyone?

Thanks for the help, offset() did the trick.


on 1/6/03 2:46 PM, Mark Brownell at [EMAIL PROTECTED] wrote:

 I just did an exact duplicate test in Director using the textCruncher Xtra
 where the same 400 kbyt text doc took 2 ticks to build my array. It also
 handle any combination of characters as the text to find. I will look into
 offset() to see if I can get both things working the way I want it. When I
 did this in Realbasic I got almost the same results as textCruncher Xtra. I
 believe that all it is is part of the string class in C++ being added as an
 Xtra, in Director. I hope I can build this fast parsing system becuse I like
 what I have seen so far in RR.
 
 on 1/6/03 2:24 PM, Dar Scott at [EMAIL PROTECTED] wrote:
 
 
 On Monday, January 6, 2003, at 11:58 AM, Mark Brownell wrote:
 
 2.) I noticed that it won't work with multiple words or empty space
 between
 characters. I would like to work with the numericle offset of
 characters and
 place that info gathered into an array if possible.
 
 Would offset() do what you want?
 I would expect this to be faster, since going to the start position
 will have constant time.
 
 (Your method probably has mc^2 time, call it E ;-), where m is the
 number of words to find and c is the length of your string in
 characters.  Using offset() should have mc time.  Why squared?  I'm
 just guessing, but I assume wordOffset() has to count up to the
 starting word each time.)
 
 Dar Scott
 
 
 ___
 use-revolution mailing list
 [EMAIL PROTECTED]
 http://lists.runrev.com/mailman/listinfo/use-revolution

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



Re: Timing (was wordOffset, repeat loop, speed?

2003-01-06 Thread Jeanne A. E. DeVoto
At 10:58 AM -0800 1/6/03, Mark Brownell wrote:
3.) I have an off-topic question about a single user pro-license. If I get
that version does it mean that I can use it on Mac  Windows to debug on
those OS

Yes. (Also Unix.) The license fee covers development and deployment on all
supported platforms, and you only pay one fee.

--
Jeanne A. E. DeVoto ~ [EMAIL PROTECTED]
Runtime Revolution Limited - The Solution for Software Development
http://www.runrev.com/


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



Re: Timing (was wordOffset, repeat loop, speed?

2003-01-06 Thread Dar Scott

On Monday, January 6, 2003, at 01:12 PM, Mark Brownell wrote:


Wow!
63 milliseconds; 206 hits; 390345 characters ...looks like I have a  
very
fast parser.

You might be able to tweak out a few more milliseconds.  Consider using 
for instead of with or making the with work harder for you.


It even works well with empty space, it gives me exactly what I
needed.


This may work OK for a single space character, but you may have 
problems with white space in general.  You may want to look closer at 
this.  You may need to split up some of your multiword words.

Dar Scott

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


Re: Timing (was wordOffset, repeat loop, speed?

2003-01-06 Thread Ken Ray
Mark,

That one's easy... you buy one license, you get all the platforms. Neat,
huh?

:-)

Ken Ray
Sons of Thunder Software
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/

- Original Message -
From: Mark Brownell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 06, 2003 2:12 PM
Subject: Re: Timing (was wordOffset, repeat loop, speed?


 Wow!
 63 milliseconds; 206 hits; 390345 characters ...looks like I have a  very
 fast parser. It even works well with empty space, it gives me exactly what
I
 needed. The array contains all first character numerical valuse for each
 hit.

 So what about multiple OS uses for the licensed person of the single pro
 version license? -- anyone?

 Thanks for the help, offset() did the trick.


 on 1/6/03 2:46 PM, Mark Brownell at [EMAIL PROTECTED] wrote:

  I just did an exact duplicate test in Director using the textCruncher
Xtra
  where the same 400 kbyt text doc took 2 ticks to build my array. It also
  handle any combination of characters as the text to find. I will look
into
  offset() to see if I can get both things working the way I want it.
When I
  did this in Realbasic I got almost the same results as textCruncher
Xtra. I
  believe that all it is is part of the string class in C++ being added as
an
  Xtra, in Director. I hope I can build this fast parsing system becuse I
like
  what I have seen so far in RR.
 
  on 1/6/03 2:24 PM, Dar Scott at [EMAIL PROTECTED] wrote:
 
 
  On Monday, January 6, 2003, at 11:58 AM, Mark Brownell wrote:
 
  2.) I noticed that it won't work with multiple words or empty space
  between
  characters. I would like to work with the numericle offset of
  characters and
  place that info gathered into an array if possible.
 
  Would offset() do what you want?
  I would expect this to be faster, since going to the start position
  will have constant time.
 
  (Your method probably has mc^2 time, call it E ;-), where m is the
  number of words to find and c is the length of your string in
  characters.  Using offset() should have mc time.  Why squared?  I'm
  just guessing, but I assume wordOffset() has to count up to the
  starting word each time.)
 
  Dar Scott
 
 
  ___
  use-revolution mailing list
  [EMAIL PROTECTED]
  http://lists.runrev.com/mailman/listinfo/use-revolution

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


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



Re: Timing (was wordOffset, repeat loop, speed?)

2003-01-05 Thread Mark Brownell

Thanks, Dar  Ken; big time. ... time for the 49'rs, Mark

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