Seth,

What does "faster" mean?  Do you have some stats?  I'd be interested in
knowing this for my own knowledge.

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On
Behalf Of Seth Newton
Sent: Monday, May 15, 2006 2:28 PM
To: web400@xxxxxxxxxxxx
Subject: Re: [WEB400] CGI vs JSP...

Brad, 

In a CGIDEV2 application, there is an HTML template that uses replacement
variables where your dynamic content will go. At runtime, APIs are used to
search/replace the replacement variables with their appropriate values.  The
difference in performance is quite noticeable, especially with a subfile
application that loads many records. 

RPGsp?s compile process pre-determines which variables and expressions will
be need to be output to the browser at compile-time. When the application
runs, sections of HTML are output as needed, and the value of variables or
expressions are also output directly, with no search/replace taking place.

As an example, let's say this is our template:

Item Number: <%ITEM%> <br>
Item Description: <%DESC%>

With CGIDEV2 and other similar tools, the logic flows like this:

1. Read Template.
2. Search my template for <%ITEM%> and replace it with RPG variable ITEM.
3. Search my template for <%DESC%> and replace it with RPG variable DESC.
4. Output template.

Steps 2 and 3 are CPU-intensive.  In a subfile application, these Search
steps may be repeated thousands of times.

RPGsp, on the other hand, reads the template at compile time, and
restructures it to execute like this. 

1. Output "Item Number:"
2. Output the value of RPG variable ITEM 
3. Output "<br> Item Description:"
4. Output the value of RPG variable DESC

Here, we have no CPU-intensive search/replace logic, which results in much
faster code.   

Seth Newton
snewton@xxxxxxxxxxxxxxxxx
Profound Logic Software, Inc.
Toll-Free: (877) 224-7768 x115
Fax: (603) 849-7757

RPGsp - iSeries Web Development has never been this easy!
Watch video demos: http://www.profoundlogic.com/video_demos/



-----Original Message-----

> 
> I am used to working with CGI from RPGsp (www.RPGsp.com), which allows 
> you to embed RPG variables into HTML templates.  However, the 
> templates are not searched at runtime.  The pages are compiled in a 
> similar way JSP's are created, and that's why it's fast ... most 
> likely faster than equivalent JSP's.

Explain how this works.  how can data from a DB be replaced anywhere except
for runtime.  

Any time you're building dynamic applications data HAS to be
inserted/replaced/built at runtime.

Brad




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.