FYI... or leprechauns

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

FYI... or leprechauns

Josh Mellicker

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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: FYI... or leprechauns

masmit
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
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: FYI... or leprechauns

Shao Sean-2
In reply to this post by Josh Mellicker
*sigh*  I can't believe you guys need to post this to the use-list  
only to make yourselves look like complete n00bs as the answer is  
very simple.. It's twice as fast because you're using half the number  
of lines of code..

-Sean

ps.. yes, this is a joke ;-)
pss Personally though, I vote for leprechauns !
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: FYI... or leprechauns

Richard Gaskin
In reply to this post by Josh Mellicker
Shao Sean wrote:
> *sigh*  I can't believe you guys need to post this to the use-list  
> only to make yourselves look like complete n00bs...

You are truly 1337.

We feel pwn3d.

:)

(Actually, typing that I just feel old <g>)

--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: FYI... or leprechauns

Josh Mellicker
In reply to this post by masmit
Well, I am condensing a lot of multiline handlers into single lines  
now :-)


On Jun 10, 2008, at 3:13 PM, Mark Smith wrote:

> 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
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution