YOUR FEEDBACK
Two great PDF creators
Michael Jahn wrote: related to the snapscan - are their an samples of the ...
SOA World Conference
Virtualization Conference
$50 Savings Expire May 23, 2008... – Register Today!


2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
POWERBUILDER LINKS YOU MUST CLICK ON


If Your Strings Don't Zing

Digg This!

Many PowerBuilder developers have tried writing Web applications in EAServer, building long strings of HTML in their components to create on-the-fly Web pages. Sometimes you get good response time...and sometimes the response time gets you.

We were building pages with 40 or more rows of data and 8-10 columns. With heading, table, and other HTML tags, we were approaching 800-1000 concatenation operations in a single function call.

Response time was bad, so we tried a number of approaches to improve it. We used one string variable within the loop and concatenated it 40 times (once for each row) to the longer string that was to be the final page. This produced some improvement, but we wanted more. It seemed to be the number of concatenations performed when building our large HTML string that was slowing us down.

We were also using a Java session bean and were starting to code more in Java. We knew that the String Buffer object in Java had an append method, so we decided to try the following:

  1. In PowerBuilder build an unbounded array of strings that were to be concatenated (see Listing 1).
  2. Return this array of strings to the JavaBean.
  3. In the JavaBean (see Listing 2) loop through the array, calling the append method for each element to create our final string of HTML.
  4. Return the string to the browser.

This approach seemed a little farfetched. We were going to loop though all the data twice, once to build the array in PowerBuilder and again to append the strings in Java. The strange thing was that it worked, and the difference between the two methods became even more dramatic as the number of concatenations increased.

We built a small application to further test our results. In this application we could specify the number of concatenations, the length of the string, and other test parameters. We found that when the number of concatenations is small, PowerBuilder is faster. However, as the number of concatenations approaches 400-500, the execution time for the methods is nearly the same. When it exceeds 400-500, building an array in PowerBuilder, passing it to Java, and concatenating it in Java is much faster than performing the concatenation in PowerBuilder.

We performed 1,700 tests each in Java and PowerBuilder, using the system timer. Figure 1 shows the results of one of our trials. All tests were performed on the same hardware. In each test we measured the time from when the request began to when the HTML string was ready to display in the browser. We found that our test results were relatively insensitive to the length of the string being concatenated except that the longer the strings, the more extreme the differences. It's definitely worth the added time to code Java to handle the concatenation when you're dealing with over 400 concatenation operations.

About Shari Brandhoy
Shari Brandhoy is a senior consultant and developer for PowerTeam in Minneapolis. She has used PowerBuilder since version 3.

PBDJ LATEST STORIES . . .
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
The PB Future: More on Graphs in PowerBuilder 11.5
Last week I posted a screen shot of the new 3D Rendering capabilities being added to some of the 3D graphs in PowerBuilder 11.5. It was met with mixed reviews on the PowerBuilder Futures newsgroup (forums.sybase.com) so I went back to the drawing board to see what I could come up with.
BluePhoenix Expands Modernization Collaboration with Microsoft
BluePhoenix announced that it has expanded its collaboration with Microsoft on legacy modernization projects. The collaboration provides customers moving their applications or databases to .NET-based environments the best in both modernization services and technical support. BluePhoeni
Sybase PowerBuilder Delivers AJAX and .NET Enhancements Enabling Rich Internet Application Development
Sybase announced that AJAX development capabilities and further Microsoft .NET enhancements have been added to the latest version of Sybase PowerBuilder 11, the premier 4GL rapid application development (RAD) tool. PowerBuilder 11.2 represents another milestone in the PowerBuilder road
PowerBuilder 11.2 Released: Sybase's Flagship IDE
Sybase has released the production version of its flagship .NET development tool - PowerBuilder version 11.2. This latest release of its premier IDE for RAD includes not only standard fixes but also a good list of new features. Here is the 'Coles Notes' version of these new features.
PowerBuilder Takes You To .NET
In June of 2007, Sybase released PowerBuilder 11. PowerBuilder developers can now deploy PowerBuilder components as .NET Assemblies or as .NET Web Services. A PowerBuilder developer can now create these .NET resources so that those who develop .NET solutions can benefit from PowerBuild
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING POWERBUILDER / SYBASE NEWS
Sybase and Sun Set Guinness World Record for World's Largest Data Warehouse
Sybase, Inc. (NYSE:SY), the largest enterprise software and services company exclusively