Revisit JSON parsing for efficiency and code quality

NEW
Unassigned

Status

()

P5
normal
7 years ago
4 months ago

People

(Reporter: rnewman, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sync:perf])

(Reporter)

Description

7 years ago
http://jackson.codehaus.org/

We do a lot of JSON. json-simple is kinda crummy. Jackson is faster and streaming.
(Reporter)

Updated

7 years ago
Priority: -- → P4
(Reporter)

Comment 1

6 years ago
Ooh! Jackson 2.0!

https://github.com/FasterXML/jackson-core
Priority: P4 → --
Target Milestone: Future → ---
(In reply to Richard Newman [:rnewman] from comment #1)
> Ooh! Jackson 2.0!
> 
> https://github.com/FasterXML/jackson-core

I did a lot of experimenting with Jackson, trying to see if it would be useful for generating JWT (not really) and improving our JSON serialization for CryptoRecords (almost certainly).  I didn't push very far for two reasons:

 * library itself is large enough that I'm not convinced it's a good fit for Fennec;
 * it would mean re-writing/updating a lot of Sync parsing code.

Some of that updating is A Good Thing -- we do too much unstructured JSON parsing for my taste -- but it's still Work That Has Little User Visible Effect.

On an unrelated note, I like Gravity Implying Capitals.
(Reporter)

Comment 3

6 years ago
(In reply to Nick Alexander :nalexander from comment #2)

> I did a lot of experimenting with Jackson, trying to see if it would be
> useful for generating JWT (not really) and improving our JSON serialization
> for CryptoRecords (almost certainly).  I didn't push very far for two
> reasons:
> 
>  * library itself is large enough that I'm not convinced it's a good fit for
> Fennec;

At least the new Jackson version is modular. But yeah, the core comes to over 600KB compiled (from 1MB of source; they have a lot of comments!). I'd want to see what happens if we prune unneeded parts of the class tree, and what the impact is after ProGuard and DEX…


>  * it would mean re-writing/updating a lot of Sync parsing code.
> 
> Some of that updating is A Good Thing -- we do too much unstructured JSON
> parsing for my taste -- but it's still Work That Has Little User Visible
> Effect.

Apart from really significant performance improvements, according to the marketing spiel. And on a mobile device, performance also means safety. If we spend 30% less time chewing on JSON and consuming memory, the chance of us dying before the sync is done is greatly reduced.

But all of this assumes that it's tuned to our workload (e.g., parser reuse). I don't know if that's the case.


> On an unrelated note, I like Gravity Implying Capitals.

Me Too®.
(Reporter)

Updated

6 years ago
Priority: -- → P3
Summary: Future: switch to Jackson → Revisit JSON parsing for efficiency and code quality
Whiteboard: [sync:perf]
(Assignee)

Updated

6 years ago
Component: Android Sync → Android Sync
Product: Mozilla Services → Android Background Services
See Also: → bug 903553

Updated

a year ago
Product: Android Background Services → Firefox for Android
Re-triaging per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195

Needinfo :susheel if you think this bug should be re-triaged.
Priority: P3 → P5
You need to log in before you can comment on or make changes to this bug.