big javascript is creating problem for browser

R

raman

Hi,

Kindly, look at the following problem.

Objective: To draw a message sequence chart (MSC) from given log file.

Input: Generated trace file (eg log.trace)

Output: log.trace.html

Strategy used:

Log file (input) --- (process with perl) --- generated html file
(output)

The perl will process input log file & it will generate a html file,
which we will open using any web browser.

Java script is being used, as html is unable to draw graphics. I am
using a java script library (wz_jsgraphics.js) which provide simple
line drawing, text display facility with appropriate size & color.

I am calling this library in my program (html file) to get the proper
output.

Problem: This program works fine for small number of messages. For
large number of message browser complaints:

A script of this page is causing Internet Explorer to run slowly. If it
continues to run, your computer may become unresponsive.

Do you want to abort the script?
Yes No


I tried it on FireFox but again FireFox complaints about size of
script, & it continuously asks user to abort or continue with this
script).

Improvement to problem: If I just shuffle around & minimize the
computational time (for example : priting all vertical lines in one
shot (since I know how many vertical lines are to be printed), Further,
if I group all the messages coming out from one layer/module & print
them performance enhances.

But such delta improvements were not enough as the input file might
contain more than 5k messages as a result, there are issues as
mentioned above.

kindly look into this issue & give me some pointers as to how to
proceed further ?

Thanks & Regards,
Raman
 
M

Martin Honnen

raman wrote:

Log file (input) --- (process with perl) --- generated html file
(output)

The perl will process input log file & it will generate a html file,
which we will open using any web browser.

Java script is being used, as html is unable to draw graphics.

As you already use Perl on the server, have you considered to create the
graphics on the server and simply include it in a HTML document with an
img element e.g.
<img src="createGraphics.pl" alt="whatever">
That way you do not depend on JavaScript in the browser.

As for those messages asking the user to allow or discontinue the
running of a script, you would have to break up your scripts into parts
and run the first part, then run the second part with setTimeout, and
have the second part use setTimeout again to run the third part and so on.

Another approach would be to generate the graphics using HTML and CSS as
on the server as I think the client-side library is not doing anything
different, it simply draws with lots of CSS positioned and colored layers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top