468,301 Members | 1,402 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,301 developers. It's quick & easy.

big javascript is creating problem for browser

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

Oct 6 '06 #1
1 1394


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.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Charlene Russ | last post: by
6 posts views Thread by TJ | last post: by
136 posts views Thread by Matt Kruse | last post: by
5 posts views Thread by petermichaux | last post: by
3 posts views Thread by Bateman27 | last post: by
24 posts views Thread by Aaron Gray | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.