The code in DCInput itself looks fairly speedy.
I haven't traced all of the code paths, but I would first see how much
time is spent in CollectionService.findAuthorizedOptimized. It is
doing a *lot* of database searching, and we may be missing an
important index. If we are, please submit a bug report.
That method also might be a bit faster if it used a HashSet or a
TreeSet rather than an ArrayList for 'collections'. Then the repeated
sequential scans of this java.util.Collection could be eliminated:
just 'add' and let Set deal with duplicates. I doubt whether this is
a significant part of the cost of this method, though. If it is,
please submit a bug report.
Profiling might help to zero in on the place(s) where this is slow.
BTW in
https://gist.github.com/blancoj/6d8e083527beaf198fe4c255104eeadf#file-dcinput-java-L191
the comparison should be '!the_id.equals(pr_collection_id)'.
--
Mark H. Wood
Lead Technology Analyst
University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu