/    Sign up×
Community /Pin to ProfileBookmark

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

Encl :
log2msc.zip

this zip file contains :
log2msc.pl : perl script
small_log.trace.html : html file for small log (output file as it should be)
big_log : big log file (which giving problem)
wz_jsgraphics : java script library

[upl-file uuid=4a06ad70-f8e0-40c5-b358-084f3c045b6c size=84kB]log2html.zip[/upl-file]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Raman spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.14,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...