question about a change to DCInput.java

13 views
Skip to first unread message

Jose Blanco

unread,
Aug 7, 2020, 3:15:32 PM8/7/20
to DSpace Technical Support
I made this change in 5.1 which did not cause any performance issues, but with 6.3 I'm seeing performance issues.

I've added a new field so that the user can map the item being entered into different collections at deposit time.  The user will be presented with a list of collections for which he/she has ADD privileges.  He/She can then select the collection(s).  

So, the building of this list is done in DCInput.java file.  I have tried several variations to create the list, but they are all too slow.  We have above 1,500 collections. I have put my code in gist.  In development where we have a lot less collections, it is slower, but not that noticeable.  Here is where the building of the list happens.  


I wonder if anyone has any insight on how to make this work more efficiently.  Presently I have removed this option from the item-input.xml file because the performance is so bad.

Thank you!
-Jose

Mark H. Wood

unread,
Aug 10, 2020, 10:37:45 AM8/10/20
to DSpace Technical Support
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
signature.asc
Reply all
Reply to author
Forward
0 new messages