Re: 30x faster JSON date parsing
Re: 30x faster JSON date parsing
- Subject: Re: 30x faster JSON date parsing
- From: Jeffrey Oleander <email@hidden>
- Date: Mon, 09 Sep 2013 13:48:13 -0400
On 2013 Sep 09, at 13:14, Marcel Weiher wrote:
On 2013 Sep 9, at 18:11 , Jens Alfke <email@hidden> wrote:
[...]
[fg160,160,160;16:34:40.488| [fg0,128,0;[;NSDateFormatter took
26.97 µsec
[fg160,160,160;16:34:48.649| [fg0,128,0;[;CBLParseDate took
0.47 µsec (58x)
Now, the tradeoff is that the optimized code parses only ISO 8601
dates — this is the informal standard used with JSON, so it’s become
really common. It looks like
"2013-09-09T17:52:12Z”.
That might actually be a feature. (Also: didn’t know ISO did
informal standards…)
Looks like a feature, to me.
The issue is users entering dates -- Julian (as in pre-Gregorian/"old
style", not yyddd), day of week, month and year (i.e. incomplete dates,
e.g. from grave-stones which were shot up in a war missing individual
digits, or chemical break-down of the material), Hebrew calendar,
Muslim calendar, Chinese, Japanese... with variant orders of the parts,
variant punctuation, etc., leap seconds, expressions like "noon" or
"nones", "first bell of the third watch" (?)... even just typographical
errors...
It at first seems like it should be sooo simple, but it is not.
I go into analysis paralysis just thinking about it... and am sorely
wishing I could just enforce ISO date entry as in the quoted example by
using pop-up menus. Some do, but the dread of customer rebellion is
strong, and they want to enter them in the slap-dash, hurried, harried
ways they're used to writing them, or finding them in their source
materials.
Near-perfection, even satisficing, in interpreting such is expensive.
MSFT Javascript (and it's non-standards) is evil, hence, JSON is evil.
Further deponent saith nought.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden