[jsword-devel] JSword GoBible Creator

DM Smith dmsmith at crosswire.org
Tue Jul 14 06:45:12 MST 2009


Stephen Denne wrote:
>>> The code I've got isn't particularly quick at the moment 
>>>       
>> (around 80  
>>     
>>> seconds), since I'm passing each verse through an XSLT
>>> transformation.
>>>       
>> The time it takes is not much of an issue. It won't be anywhere near  
>> that long on the CrossWire server. We may need to put up a 
>> "Please be  
>> patient" sign.
>>     
>
> I was curious where the time was going, and found one process taking up a huge amount of time for no gain:
>
> TransformingSAXEventProvider.getTemplateInfo() which was being called for every verse, checks the last modified time of the
> stylesheet by calling NetUtil.getLastModified(xsluri) to see whether it can use a cached copy.
> Changing the last modified time to 0 meant the time went down to 55 seconds.
> Could this possibly be changed to a configurable capability?
>   
Certainly it can be changed.

I'm really surprised that it is called once for every verse. The pattern 
that BibleDesktop uses is to gather all the requested verses into a 
buffer and call the stylesheet once on it. Is it that each verse is 
indexed and thus built separately in the GoBible module?

There is a lot of other repeated overhead that happens that we have 
considered too small given the expected use pattern.
> TransformerFactory.newInstance() is called for every verse.
> Inlining that variable to the only place it is used, in getTemplateInfo() when the stylesheet is not in the cache, means it'll get
> called only when needed.
> The time went down to 34 seconds.
>   

This too can change.

Would you open a "bug" in Jira (www.crosswire.org/bugs) against JSword? 
Just one for both of these would be fine. If you want to work up a patch 
for it, appending it to the issue, please make yourself the issue owner. 
Otherwise assign it to me.

Many thanks,
    DM Smith
> Regards,
> Stephen Denne.
>
>
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel
>   




More information about the jsword-devel mailing list