https://bz.apache.org/bugzilla/show_bug.cgi?id=70159
Bug ID: 70159
Summary: Caching of date pattern in DateUtilisADateFormat
Product: POI
Version: unspecified
Hardware: PC
OS: Mac OS X 10.1
Status: NEW
Severity: normal
Priority: P2
Component: SS Common
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 40202
--> https://bz.apache.org/bugzilla/attachment.cgi?id=40202&action=edit
Patch of fix with test.
Somewhat related to a very old bug:
https://bz.apache.org/bugzilla/show_bug.cgi?id=55611, I'm doing some profiling
on a Tika document processor that is calling DateUtil.isADateFormat quite a bit
and repeatedly hitting the line "if (! date_ptrn3a.matcher(fs).find()) {",
evaluating to true and then returning false. Running over a 100+K documents,
it was surprising to me this line showed up at all, but it does look like it
could be cached, which should save a fair bit for future calls.
I believe the fix is simply:
if (! date_ptrn3a.matcher(fs).find()) {
>>>> cache(formatString, formatIndex, false);
return false;
}
First time posting here, so apologies if I messed up something. Not sure if
patches are still accepted, but one is attached.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]