FYI... or leprechauns

Mark Smith mark at maseurope.net
Tue Jun 10 18:13:32 EDT 2008


Josh, I just saw the same thing on a bunch of audio files - and that  
was just doing:


get url ("binfile:" & tFile))
add length(it) to total

and then

add length(url ("binfile:" & tFile)) to total

version 2 was twice as fast as version 1, just as you observed.

Maybe, in version 1, when the the engine reads the file, it's read  
into a buffer which is then copied into the variable 'it' which takes  
time, whereas in version 2, the work is done on the contents of the  
buffer.

?

Best,

Mark

On 10 Jun 2008, at 21:39, Josh Mellicker wrote:
>
> Running the following code (in a loop):
>
> get URL ("binfile:" & tLocal)
> put the base64encode of the md5digest of it into tLocalMD5
>
> on 103 files (most of them 10 - 30 MB QT files):
>
>  - took 6 minutes
>  - slowed the whole computer to a crawl- really hard to access  
> email, browser, etc.
>
>
> However, changing this code to this single line:
>
> put the base64encode of the md5digest of (URL ("binfile:" &  
> tLocal)) into tLocalMD5
>
>  - took 3 minutes
>  - computer was responsive, other apps behaved fairly normally
>
>
>
> One theory being circulated is that the first block of code had to  
> load the entire file (a 20 MB QT movie, for example) into memory,  
> whereas the second read the file from the disk.
>
> My theory is that we have gone mad, or there are leprechauns.
>
> Which is it?
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list