[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search
 
Modify

CLDR Ticket #7108(accepted defect)

Opened 3 years ago

Last modified 2 years ago

Remaing cleanup of Factory.HandleMake

Reported by: mark Owned by: googler
Component: perf Data Locale:
Phase: dsub Review:
Weeks: Data Xpath:
Xref:

ticket:6995

Description

There is remaining work on ticket:6995 that needs to be done early in the next release. In particular, the items from comment:3

SimpleFactory?.java
I think this needs some more detailed review. For example, we are doing a file-system tree walk on every access, which is not going to be particularly speedy. The code seems more convoluted than necessary, so let's sit down and walk through it.

Minor:
final int prime = 31;
This should be a constant (static final)
97 if (obj == null) {
98 return false;
99 }
we know we'll never compare against null, and better to just catch the exception (see below).
100 if (getClass() != obj.getClass()) {
101 return false;
102 }
While this is in theory better, in a private class we know the usage. Faster to just cast and catch the exception.
104 if (directory == null) {
105 if (other.directory != null) {
106 return false;
107 }
Can the directory or locale be null? If so, as a key, would be better to set to the empty string, to make equals faster. Also, create and cache the hash code, and compare that first.

Same goes for other new classes, like SimpleFactoryLookupKey?

Attachments

Change History

comment:1 Changed 3 years ago by mark

  • Priority changed from assess to major
  • Type changed from unknown to defect
  • Xref set to 6995
  • Component changed from unknown to perf

comment:2 Changed 3 years ago by emmons

  • Owner changed from anybody to ribnitz
  • Status changed from new to assigned
  • Milestone changed from UNSCH to 26rc

comment:3 Changed 3 years ago by mark

  • Owner changed from ribnitz to googler

comment:4 Changed 3 years ago by mark

  • Milestone changed from 26rc to 27dsub

comment:5 Changed 3 years ago by markus

  • Phase set to dsub
  • Milestone changed from 27dsub to 27

comment:6 Changed 2 years ago by emmons

  • Milestone changed from 27 to UNSCH

comment:7 Changed 2 years ago by srl

  • Status changed from assigned to accepted
View

Add a comment

Modify Ticket

Action
as accepted
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.