Hi –

I’ve just found the reason the file I was looking at was not loading (or 
actually is loading but extremely slowly). The bad news is it looks like it’s 
been in the code since Aug 2016 but the good news is it looks very fixable.

The initialisation is being held up in Alignment::resolveAndAddDatasetSeq which 
is in the call stack called by the AlignFrame initialisation code. The code 
here has a LinkedIdentityHashSet seqs containing all the sequences it has 
looked at so far. When it gets the next sequence it calls seqs.contains to see 
if the sequence is already in seqs, if not, it adds the sequence to seqs. The 
slow bit is the seqs.contains call: if I have 85,000 sequences in seqs it takes 
around 0.5 secs to do one check, so another 200,000+ is going to take a while…

The reason seqs.contains is slow is because, despite the name, 
LinkedIdentityHashSet::contains is doing a linear search. This rather echoes 
what I was saying earlier about checking our data structures are appropriate.

I’ll log a JIRA issue for this. It would be useful to know what the purpose of 
using LinkedIdentityHashSet here was though, as this is the only place it’s 
used in the code.

Cheers
Kira





[cid:[email protected]]<http://uod.ac.uk/sig-home>



Kira Mourão

Postdoctoral Researcher
The Barton Group
Division of Computational Biology
School of Life Sciences
University of Dundee, Dundee, Scotland, UK.
[email protected]<mailto:[email protected]>
www.jalview.org<http://www.jalview.org/>
www.compbio.dundee.ac.uk<http://www.compbio.dundee.ac.uk/>
Twitter @kiramt



[cid:[email protected]]<http://uod.ac.uk/sig-fb>[cid:[email protected]]<http://uod.ac.uk/sig-tw>[cid:[email protected]]<http://uod.ac.uk/sig-li>[cid:[email protected]]<http://uod.ac.uk/sig-yt>[cid:[email protected]]<http://uod.ac.uk/sig-ig>[cid:[email protected]]<http://uod.ac.uk/sig-sc>

We're Scottish University of the Year again!<http://uod.ac.uk/sig-strapline>



The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
Jalview-dev mailing list
[email protected]
http://www.compbio.dundee.ac.uk/mailman/listinfo/jalview-dev

Reply via email to