A list for the developers of CellML tools

Text archives Help


[cellml-dev] Very slow getPositionInXML function in VACSS


Chronological Thread 
  • From: ak.miller at auckland.ac.nz (Andrew Miller)
  • Subject: [cellml-dev] Very slow getPositionInXML function in VACSS
  • Date: Thu, 19 Jan 2012 21:08:47 +1300

On 19/01/12 20:59, Alan Garny wrote:
> Hi Andrew,
>
>> getPositionInXML needs to traverse the entire DOM to find the position of
> the
>> desired target variable for each call - it does not cache position
> information
>> so it re-does the calculation for each call from the start of the
> document.
>
> Ok, that's what I then thought from having a look at the code.
>
>> If you just want to take a user to an element when they click on it, it
> would be
>> better to use the element itself rather than the position to find that
> element.
>
> How do you mean "click on it"? Click on what? Right now, I am thinking about
> someone opening a CellML file and having that file presented to the user in
> a 'simple' text editor. From there, there would be a list of
> errors/warnings. The user could then double click on a list item and this
> would get him straight to the line/column where the error/warning is. This
> is what I would like to have for my 'Raw CellML' view and, right now, it
> seems like I can't offer that functionality unless the user is willing to
> wait 40+ seconds to open the moderately big model I mentioned in my original
> message.
>
>> I'd suggest trying to call it as late as possible so you aren't calling it
> for a large
>> batch of elements.
>
> When someone opens a CellML model, I want that person to know straightaway
> whether the model contains errors/warnings, so not an option.

We are talking about getPositionInXML, not running VACSS validation -
you can get the list of errors, but it is assigning line and column
numbers in the raw XML to those errors that is expensive. Why not just
do what the xulrunner-based OpenCell did, and show the errors, without a
line number, and only work out where the error is in the file at the
point the user wants to go to the error location?

Best wishes,
Andrew




Archive powered by MHonArc 2.6.18.

Top of page