Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4504)

Issue 295240043: DateTimePattern skeleton string optimization - C++ (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 11 months ago by sffc
Modified:
7 years, 11 months ago
Reviewers:
markus.icu
CC:
fabalbon
Base URL:
svn+icussh://source.icu-project.org/repos/icu/icu/trunk/source/
Visibility:
Public.

Description

DateTimePattern skeleton string optimization - C++

Patch Set 1 #

Patch Set 2 : Updating with feedback form Java version. #

Total comments: 56

Patch Set 3 : Updating with Markus's first round of feedback. #

Total comments: 17

Patch Set 4 : Updating with Markus's second round of feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+197 lines, -133 lines) Patch
M i18n/dtptngen.cpp View 1 2 3 19 chunks +150 lines, -124 lines 0 comments Download
M i18n/dtptngen_impl.h View 1 2 3 2 chunks +45 lines, -6 lines 0 comments Download
M i18n/unicode/dtptngen.h View 1 2 3 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 14
sffc
This change reduces the memory consumption of PatternMap (inside DateTimePatternGenerator) from 86 KB to 8 ...
7 years, 11 months ago (2016-05-19 01:32:51 UTC) #1
sffc
Updating with feedback form Java version.
7 years, 11 months ago (2016-05-20 23:42:17 UTC) #2
sffc
Updating C++ data structures for Java consistency. https://codereview.appspot.com/295240043/diff/20001/i18n/dtptngen.cpp File i18n/dtptngen.cpp (right): https://codereview.appspot.com/295240043/diff/20001/i18n/dtptngen.cpp#newcode1067 i18n/dtptngen.cpp:1067: if (Canonical_Items[i] ...
7 years, 11 months ago (2016-05-20 23:48:58 UTC) #3
sffc
Incorporating the changes in Java to C++.
7 years, 11 months ago (2016-05-21 00:00:00 UTC) #4
markus.icu
https://codereview.appspot.com/295240043/diff/20001/i18n/dtptngen.cpp File i18n/dtptngen.cpp (right): https://codereview.appspot.com/295240043/diff/20001/i18n/dtptngen.cpp#newcode424 i18n/dtptngen.cpp:424: if (U_FAILURE(status)) { return; } remove this line, the ...
7 years, 11 months ago (2016-05-27 23:24:07 UTC) #5
sffc
Updating with Markus's first round of feedback.
7 years, 11 months ago (2016-05-28 01:10:43 UTC) #6
sffc
Updating with Markus's first round of feedback.
7 years, 11 months ago (2016-05-28 01:30:42 UTC) #7
sffc
C++ isn't my first language. :) https://codereview.appspot.com/295240043/diff/20001/i18n/dtptngen.cpp File i18n/dtptngen.cpp (right): https://codereview.appspot.com/295240043/diff/20001/i18n/dtptngen.cpp#newcode424 i18n/dtptngen.cpp:424: if (U_FAILURE(status)) { ...
7 years, 11 months ago (2016-05-28 01:34:48 UTC) #8
markus.icu
https://codereview.appspot.com/295240043/diff/20001/i18n/dtptngen.cpp File i18n/dtptngen.cpp (right): https://codereview.appspot.com/295240043/diff/20001/i18n/dtptngen.cpp#newcode1068 i18n/dtptngen.cpp:1068: addPattern(UnicodeString(Canonical_Items[i]), FALSE, conflictingPattern, status); On 2016/05/28 01:34:47, sffc wrote: ...
7 years, 11 months ago (2016-05-28 18:15:39 UTC) #9
markus.icu
https://codereview.appspot.com/295240043/diff/60001/i18n/dtptngen.cpp File i18n/dtptngen.cpp (right): https://codereview.appspot.com/295240043/diff/60001/i18n/dtptngen.cpp#newcode424 i18n/dtptngen.cpp:424: UnicodeString hackPattern = addICUPatterns(locale, status); On 2016/05/28 18:15:39, markus.icu ...
7 years, 11 months ago (2016-05-28 18:52:02 UTC) #10
sffc
Updating with Markus's second round of feedback.
7 years, 11 months ago (2016-05-31 22:31:51 UTC) #11
sffc
https://codereview.appspot.com/295240043/diff/20001/i18n/dtptngen.cpp File i18n/dtptngen.cpp (right): https://codereview.appspot.com/295240043/diff/20001/i18n/dtptngen.cpp#newcode1068 i18n/dtptngen.cpp:1068: addPattern(UnicodeString(Canonical_Items[i]), FALSE, conflictingPattern, status); On 2016/05/28 18:15:38, markus.icu wrote: ...
7 years, 11 months ago (2016-05-31 22:34:37 UTC) #12
markus.icu
LGTM https://codereview.appspot.com/295240043/diff/60001/i18n/dtptngen.cpp File i18n/dtptngen.cpp (right): https://codereview.appspot.com/295240043/diff/60001/i18n/dtptngen.cpp#newcode424 i18n/dtptngen.cpp:424: UnicodeString hackPattern = addICUPatterns(locale, status); On 2016/05/31 22:34:37, ...
7 years, 11 months ago (2016-05-31 22:47:11 UTC) #13
sffc
7 years, 11 months ago (2016-05-31 23:50:17 UTC) #14
Submitted as r38780.

https://codereview.appspot.com/295240043/diff/60001/i18n/dtptngen.cpp
File i18n/dtptngen.cpp (right):

https://codereview.appspot.com/295240043/diff/60001/i18n/dtptngen.cpp#newcode424
i18n/dtptngen.cpp:424: UnicodeString hackPattern = addICUPatterns(locale,
status);
On 2016/05/31 22:47:10, markus.icu wrote:
> On 2016/05/31 22:34:37, sffc wrote:
> > On 2016/05/28 18:52:02, markus.icu wrote:
> > > On 2016/05/28 18:15:39, markus.icu wrote:
> > > > What's up with hackPattern? Is it a temporary debugging thing? It looks
> like
> > > > it's always empty.
> > > 
> > > Sorry, I didn't see it getting set when I just looked at diffs from ps2.
> After
> > > looking at the Java sink changes, I see what's going on.
> > > 
> > > Please   s/hackPattern/shortTimePattern/   to make it consistent with
Java,
> > and
> > > less, well, hack-y...
> > 
> > In C++, it's a different string that gets saved as the "hackPattern".  C++
> uses
> > the DateFormat::kMedium pattern, but Java uses the DateFormat.SHORT pattern.

> > Who's right?
> 
> I don't know who is right, but I am sure that they should behave the same.
> Please submit an ICU ticket for this.

I checked the SVN history, and in C++, the "hackPattern" thing originates all
the way back from the original commit of this file, in revision 22029
(7/18/2007).  In Java, this variable was originally named "hackPattern" and used
the MEDIUM format pattern, but in revision 25662 (ticket:6800, 3/26/2009),
yoshito changed the name of the variable and made it use the SHORT format
pattern instead.  Appears he may have missed it in C++.

Make a ticket, or change C++ to use SHORT?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b