Bug 87385 - Should cache Collators for ViewerSorters
Summary: Should cache Collators for ViewerSorters
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Dejan Glozic CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2005-03-08 10:47 EST by Tod Creasey CLA
Modified: 2005-03-08 11:23 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2005-03-08 10:47:56 EST
There are the following references to new ViewerSorter() in Help. This method
creates a Collator using Collator.getInstance() which can take around 200ms (on
my hyperthreaded machine). If you cache a collator you might get a good
performance saving.

ContextHelpSorter
FederatedSearchSorter
SorterByScore
Comment 1 Dejan Glozic CLA 2005-03-08 10:58:20 EST
Tod, the implementation of Collator.getInstance() already uses cache. Why 
would my own caching improve performance?
Comment 2 Dejan Glozic CLA 2005-03-08 11:06:45 EST
Ah, I think I know - they do cache but 'getInstance' actually returns a clone, 
not the instance itself.
Comment 3 Dejan Glozic CLA 2005-03-08 11:23:45 EST
Implemented by initializing one static instance in the view and reusing that 
instance between sorters.