Closed Bug 709185 Opened 13 years ago Closed 3 years ago

Revisit JSON parsing for efficiency and code quality

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: rnewman, Unassigned)

References

Details

(Whiteboard: [sync:perf])

http://jackson.codehaus.org/

We do a lot of JSON. json-simple is kinda crummy. Jackson is faster and streaming.
Priority: -- → P4
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.
(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®.
Priority: -- → P3
Summary: Future: switch to Jackson → Revisit JSON parsing for efficiency and code quality
Whiteboard: [sync:perf]
Product: Mozilla Services → Android Background Services
See Also: → 903553
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
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.