Just a short report, for the record, of my experience with the profiler
now built into XSLTForms.

Short version:  the profiler is very helpful; in this case three relatively
simple changes produced a five-fold speedup in the form. 

Long version:

Looking at the profile information for the form I was worrying about, 
which had gotten too slow when the document it was operating on got
bigger, I found that the most expensive XPath expressions were those
used for numbering the cells of the stack and for numbering the
instructions in the code area.  I hard-coded appropriate numbers into
attributes in the machine description, and I added a set of actions for
adding a numbering attribute to the instructions in a program, after
loading it. I then replaced each XPath expression of the form 
count(preceding-sibling::cell) +1 or count(preceding-sibling::i) with
a reference to @n.  I also removed the support for editing the program
code; I'll move it to a separate form which communicates with the
main form by bouncing the XML representation of the document off
of a routine on the server.

The first two changes (prenumbering the stack cells and autonumbering
the instructions in the program) reduced the XForms Cumulative Refresh 
Time after loading a program and stepping through 50 cycles of machine
time (i.e. clicking Step 50 times) from 94.6 seconds to 42.3 seconds,
making the program about twice as fast.  

The third change (removing the editing functionality to a separate form)
took it down to 17.7 seconds, another twofold speedup, for a five-fold 
speedup overall.  

Those who are curious can compare the timings and the subjective
experience of the form by looking at the old and new versions of the
form at

http://blackmesatech.com/2011/12/pl0/v01.xhtml (old)
http://blackmesatech.com/2011/12/pl0/index.xhtml (new)

(Hmm.  I notice that the XSLTforms I'm using on that server is
an old version that doesn't yet have the profiler.  I'll have to update soon.)

-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************





------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support

Reply via email to