[jsword-devel] New versification mapping - preload mappings to prevent pauses

Martin Denham mjdenham at gmail.com
Thu Jan 16 13:04:35 MST 2014


There is something unusual happening with the v11n mapping creation
straight after downloading a file requiring mapping e.g. It takes over 2
mins to load the mapping (a single call to mapVerse) for RusSynodal
straight after download but a few seconds to load the file normally.

1. View ESV and anything else in split screen
2. Download RusSynodal
3. Exit download screen after download
4. select RusSynodal for display (with ESV) in 1 half of split screen
5. Mapping code now takes over 2 minutes to load mapping
6. But there are no errors and then everything seems fine

7. Exit and kill And Bible
8. Restart with ESV/RST in split screens
9. This time everything is initialised in a few seconds

Any ideas?

Martin


On 16 January 2014 19:06, Chris Burrell <chris at burrell.me.uk> wrote:

> Hi Martin
>
> Fine by me. Think it should be opt in if possible.
>
> A couple of thoughts on that note. Do you know of it s the io or the cpu
> time that's the issue?
>
> We probably want to opt in with a list as well as all as there's no point
> in loading the v11n if not required.
>
> I guess especially if we end up with mappings per module eventually.
>
> On a separate note, I also found the books.installed call is very
> expensive. Thinking it may be worth partially loading these. With around
> 200 modules we spend almost 15 seconds loading them.
>
> Finally you can apply for a open source license of jprofiler which helps
> massively to work out what's going on. Have got a couple of uncommitted
> fixes for books. Installed find with that.
>
> Chris
> On 16 Jan 2014 18:10, "Martin Denham" <mjdenham at gmail.com> wrote:
>
>> Hi,
>>
>> I have integrated the new v11n mapping code and find I am getting a pause
>> when doing the initial mapping between any 2 v11ns.
>>
>> I originally had the same problem with the AB mapping code so pre-loaded
>> all mapping required for the installed set of documents at the start in a
>> background thread to prevent delays.  The code I used is in
>> VersificationMappingFactory.initialiseRequiredMappings()<https://github.com/mjdenham/and-bible/blob/master/AndBible/src/net/bible/android/control/versification/mapping/VersificationMappingFactory.java>
>> .
>>
>> I am trying to think of the best way to do this in the new code.  Either
>> i) you could add a method to do it which could be called or ii) you could
>> proeload all required mappings automatically or iii) add a new method to
>> allow AB (or other frontend) to trigger preload of all required mappings by
>> adding a public method a bit like the new
>> VersificationsMapper.ensure(v11ntopreload).
>>
>> This is quite an issue for mobile users.  I have a fast mobile and
>> loading a mapping causes a noticeable delay the first time a verse changes,
>> but the preload fix is fairly simple and worked well.
>>
>> Cheers
>> Martin
>>
>>
>> _______________________________________________
>> jsword-devel mailing list
>> jsword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/jsword-devel
>>
>>
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20140116/30836be2/attachment.html>


More information about the jsword-devel mailing list