on-rev example: 'globals.cgi' conversion

Mark Smith lists at futilism.com
Sat Apr 18 15:44:41 EDT 2009


On 18 Apr 2009, at 20:24, Richard Gaskin wrote:
>>
>
> The CGI is indeed fast, but if the timing is being measured inside  
> the script it's not accounting for the biggest difference between  
> the CGI and on-Rev:  on-Rev has no load time to bring the engine  
> into memory and initialize it since it's already loaded and  
> running, while the CGI engine has to be loaded fresh each time it's  
> called.
>
> Even with that extra overhead the Rev CGI measures well against  
> equivalent CGIs, but I'd be surprised if it could beat on-Rev.
>
> --
>
if you put this in a button you can see another test:

on mouseUp
    put "http://marksmith.on-rev.com/mashash/hashmac.irev? 
data=somedata&key=somekey&action=md5hmac" into tIrevUrl
    put "http://marksmith.on-rev.com/cgi-bin/hashmac.cgi? 
data=somedata&key=somekey&action=md5hmac" into tCgiUrl

    put the millisecs into ts
    put url tIrevUrl into tResA
    put the millisecs - ts into tTimA

    put the millisecs into ts
    put url tCgiUrl into tResB
    put the millisecs - ts into tTimB

     put "irev:" & tTimA && tResA & cr & "cgi:" & tTimB && tResB
end mouseUp

I'm seeing the cgi taking 190-200 ms and the irev taking 170-180 ms.

The irev is 'including' a textified version of my hash/hmac library,  
and the cgi is loading a stack which inserts the library (and a few  
others) into back, so perhaps the test is slightly skewed in irev's  
favour.

I'll leave it up for a few hours if anyone wants to try it out (I'd  
also be interested in other people's timing from different places -  
I'm in London).

Best,

Mark



More information about the use-livecode mailing list