You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Ian Boston (JIRA)" <ji...@apache.org> on 2008/07/15 21:07:31 UTC

[jira] Created: (SHINDIG-451) JSON Serialization using net.sf.json-lib

JSON Serialization using net.sf.json-lib
----------------------------------------

                 Key: SHINDIG-451
                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
             Project: Shindig
          Issue Type: Improvement
          Components: OpenSocial  feature (Javascript), RESTful API (Java)
            Reporter: Ian Boston


Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).

The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.

Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614091#action_12614091 ] 

Kevin Brown commented on SHINDIG-451:
-------------------------------------

This is starting to look great.

Do you have commit access yet? I don't recall whether everything was complete yet or not.

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ian Boston updated SHINDIG-451:
-------------------------------

    Attachment: SHINDIG-451.patch

All unit tests within the patch now work. 

Still needs to have some performance tests to benchmark the approach wrt other methods.

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Updated: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by Kevin Brown <et...@google.com>.
I don't see any issue with it, though we should keep this issue open until
all the usage of the json.org version has been replaced.

On Sat, Jul 19, 2008 at 4:31 AM, Ian Boston <ie...@tfd.co.uk> wrote:

> I am treading very carefully now....
> Are there any objections to me committing this?
> at the moment it does not replace the existing json implementation, but if
> does modify some of the poms.
>
> Ian
>
>
> On 18 Jul 2008, at 18:22, Ian Boston (JIRA) wrote:
>
>
>>     [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>> ]
>>
>> Ian Boston updated SHINDIG-451:
>> -------------------------------
>>
>>    Attachment: SHINDIG-451.patch
>>
>> Updated patch to include filtering and brought upto trunk r677964
>>
>>  JSON Serialization using net.sf.json-lib
>>> ----------------------------------------
>>>
>>>                Key: SHINDIG-451
>>>                URL: https://issues.apache.org/jira/browse/SHINDIG-451
>>>            Project: Shindig
>>>         Issue Type: Improvement
>>>         Components: OpenSocial  feature (Javascript), RESTful API (Java)
>>>           Reporter: Ian Boston
>>>        Attachments: SHINDIG-451.patch
>>>
>>>
>>> Progress on a patch to use json-lib to perform serialization of the
>>> inbound and outbound json messages, at the moment it re-uses the rhino from
>>> Shindig 412, but only in the tests to give finer grain control in the test
>>> cases. The Enum handling in json-lib is neat :).
>>> The unit tests that are not currently working are disabled with a Xtest,
>>> but Person and activity with some depth in the tree are working.
>>> Will attache the patch in a moment.
>>>
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>

Re: [jira] Updated: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by Ian Boston <ie...@tfd.co.uk>.
I am treading very carefully now....
Are there any objections to me committing this?
at the moment it does not replace the existing json implementation,  
but if does modify some of the poms.

Ian

On 18 Jul 2008, at 18:22, Ian Boston (JIRA) wrote:

>
>      [ https://issues.apache.org/jira/browse/SHINDIG-451? 
> page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Ian Boston updated SHINDIG-451:
> -------------------------------
>
>     Attachment: SHINDIG-451.patch
>
> Updated patch to include filtering and brought upto trunk r677964
>
>> JSON Serialization using net.sf.json-lib
>> ----------------------------------------
>>
>>                 Key: SHINDIG-451
>>                 URL: https://issues.apache.org/jira/browse/ 
>> SHINDIG-451
>>             Project: Shindig
>>          Issue Type: Improvement
>>          Components: OpenSocial  feature (Javascript), RESTful API  
>> (Java)
>>            Reporter: Ian Boston
>>         Attachments: SHINDIG-451.patch
>>
>>
>> Progress on a patch to use json-lib to perform serialization of  
>> the inbound and outbound json messages, at the moment it re-uses  
>> the rhino from Shindig 412, but only in the tests to give finer  
>> grain control in the test cases. The Enum handling in json-lib is  
>> neat :).
>> The unit tests that are not currently working are disabled with a  
>> Xtest, but Person and activity with some depth in the tree are  
>> working.
>> Will attache the patch in a moment.
>
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>


[jira] Updated: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ian Boston updated SHINDIG-451:
-------------------------------

    Attachment: SHINDIG-451.patch

Updated patch to include filtering and brought upto trunk r677964

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614105#action_12614105 ] 

Ian Boston commented on SHINDIG-451:
------------------------------------

Some comparative timing tests, Output is SpecialPerson -> JSON String input is the same JSON -> SpecialPerson (see the unit tests for def of special person)

Unfortunately the JSON String -> SpecialPerson bean throws an exception for the ORG JSON Lib based converter, (my SpecialPerson is fully populated).  

The tests are over 10,000 operations, random out, but static in, showing about 60% of the time for the SF JSON Lib based approach. I will try and get something for GC activity soon, but this tends to be a bit hit and miss in a VM just running a test, as it really depends on the dwell time in Eden in real life. 

Its probably going to be worth spending some time in a profiler just to check that there are no stupid mistakes on my part.

INFO SF JSON Lib Output 0.4024 ms/conversion  [2008-07-16 22:04:10,294] (JsonConverterPerformanceTest.java:128) 
INFO SF JSON Lib Input 1.3388 ms/conversion  [2008-07-16 22:04:23,820] (JsonConverterPerformanceTest.java:141) 
INFO ORG JSON Lib Output 0.6292 ms/conversion  [2008-07-16 22:04:30,209] (JsonConverterPerformanceTest.java:155) 

Will update the patch soon.



> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614438#action_12614438 ] 

Kevin Brown commented on SHINDIG-451:
-------------------------------------

The inclusion of null fields worries me quite a bit, given the high levels of verbosity for people data. Can we manually ensure that these fields won't get set somehow? Size of output is a much bigger issue than CPU time or memory usage, since that's what impacts users the most.

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ian Boston updated SHINDIG-451:
-------------------------------

    Attachment:     (was: SHINDIG-451.patch)

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613756#action_12613756 ] 

Kevin Brown commented on SHINDIG-451:
-------------------------------------

We should probably treat this as a multi-part issue, with the eventual goal of converting all usage of org.json.* to the net.sf.* versions. I don't like having two different JSONObjects floating around the code.

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614302#action_12614302 ] 

Ian Boston commented on SHINDIG-451:
------------------------------------

Update on the comparative tests, below,
Some observations. 
1. Its not that easy to get reliable memory stats, so these might be wrong.
2. The SF JSON library is serializing all properties (as per the output) whereas the original implementation was serializing only the properties that have been set.
3. SF JSON takes 60% of the time and about 75% the memory overhead per pojo -> json string conversion wrt the ORG JSON version, however the output is about 10x the size due to sending empty values.
4. I still don't have comparative results on input, but input on SF JSON is more expensive than output.

BTW, I am seeing error bars of about +-10% on most of these figures.

INFO SF JSON Lib Output 0.436 ms/conversion, 188.96313 heap bytes/conversion, output packet consumed on average 2133.057 for a string length of 1043  [2008-07-17 12:43:17,878] (JsonConverterPerformanceTest.java:142) 
INFO Output Was [{"addresses":[],"sexualOrientation":null,"happiestWhen":null,"ethnicity":null,"books":[],"profileVideo":null,"profileUrl":null,"turnOffs":[],"id":"0","scaredOf":null,"humor":null,"bodyType":null,"lookingFor":null,"turnOns":[],"music":[],"urls":[],"tags":[],"heroes":[],"gender":null,"nickname":null,"drinker":null,"religion":null,"newfield":"nonsense","pets":null,"interests":[],"isOwner":false,"relationshipStatus":null,"movies":[],"networkPresence":null,"currentLocation":null,"dateOfBirth":null,"schools":[],"smoker":null,"romance":null,"food":[],"profileSong":null,"updated":null,"age":0,"sports":[],"cars":[],"phoneNumbers":[],"activities":[],"aboutMe":null,"politicalViews":null,"name":{"honorificPrefix":null,"honorificSuffix":null,"unstructured":"robot","additionalName":null,"givenName":null,"familyName":null},"tvShows":[],"fashion":null,"timeZone":0,"thumbnailUrl":null,"emails":[],"livingArrangement":null,"jobs":[],"status":null,"jobInterests":null,"isViewer":false,"hasApp":false,"languagesSpoken":[],"quotes":[],"children":null}]  [2008-07-17 12:43:17,901] (JsonConverterPerformanceTest.java:148) 
INFO SF JSON Lib Input 1.262 ms/conversion, 1929.5159 heap bytes/conversion, person object consumed on average 322.1496  [2008-07-17 12:43:34,538] (JsonConverterPerformanceTest.java:179) 
INFO ORG JSON Lib Output 0.5459 ms/conversion, 252.1544 heap bytes/conversion, output packet consumed on average 237.5096 for a string length of 97  [2008-07-17 12:43:40,211] (JsonConverterPerformanceTest.java:213) 
INFO Output Was [{"newfield":"nonsense","name":{"unstructured":"robot"},"id":"0","isOwner":false,"isViewer":false}]  [2008-07-17 12:43:40,216] (JsonConverterPerformanceTest.java:219) 





> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ian Boston updated SHINDIG-451:
-------------------------------

    Attachment: SHINDIG-451.patch

Updated with a performance test code class, which probably needs to be disabled from the maven build. (TODO)

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ian Boston updated SHINDIG-451:
-------------------------------

    Attachment: SHINDIG-451.patch

Preliminary patch, which I am still working on, so please don't apply to trunk

Please say if this the the wrong approach or not required. 
Thanks 
Ian


> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614783#action_12614783 ] 

Ian Boston commented on SHINDIG-451:
------------------------------------

New results with the correct filter in place, the messages are now the same size and SF JSON is about 3 times faster on output than ORG JSON. Will update the patch in a minute.



INFO SF JSON Lib Output 0.1697 ms/conversion, 35.587204 heap bytes/conversion, output packet consumed on average 233.6064 for a string length of 97  [2008-07-18 17:36:50,835] (JsonConverterPerformanceTest.java:142) 
INFO Output Was [{"newfield":"nonsense","name":{"unstructured":"robot"},"isOwner":false,"id":"0","isViewer":false}]  [2008-07-18 17:36:50,838] (JsonConverterPerformanceTest.java:148) 
INFO SF JSON Lib Input 0.1298 ms/conversion, 217.01837 heap bytes/conversion, person object consumed on average 320.088  [2008-07-18 17:36:53,966] (JsonConverterPerformanceTest.java:179) 
INFO ORG JSON Lib Output 0.59 ms/conversion, 34.423996 heap bytes/conversion, output packet consumed on average 233.1744 for a string length of 97  [2008-07-18 17:37:00,147] (JsonConverterPerformanceTest.java:213) 
INFO Output Was [{"newfield":"nonsense","name":{"unstructured":"robot"},"id":"0","isOwner":false,"isViewer":false}]  [2008-07-18 17:37:00,148] (JsonConverterPerformanceTest.java:219) 



> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Andres Almiray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614584#action_12614584 ] 

Andres Almiray commented on SHINDIG-451:
----------------------------------------

Yes, you can filter out properties with SF JSON in several ways:
1) defining a exclusion list in JsonConfig.setExcludes(String[])
2) registering a JsonBeanProcessor (which is a custom POJO serializer)
3) registering a PropertyFilter with jsonConfig.setJsonPropertyFilter()

I believe you are looking for option #3 because it takes into account the value of the property
(http://json-lib.sourceforge.net/apidocs/jdk15/net/sf/json/util/PropertyFilter.html)
The following filter fill skip adding any null property into the resulting JSONObject

JsonConfig jsonConfig = new JsonConfig()
jsonConfig.setJsonPropertyFilter( new PropertyFilter() {
   public void apply( Object source, String name, Object value ) {
      return value == null // if true then source.name will be filtered out
   }
})
JSON json = JSONObject.fromObject( jsonStr, jsonConfig )

Regarding performance, it is understandable from the point of view that SF JSON does more than ORG JSON when serializing back and forth between Java and JSON, still performance is still a key issue and efforts have been made to improve it.

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Andres Almiray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614786#action_12614786 ] 

Andres Almiray commented on SHINDIG-451:
----------------------------------------

Now that makes more sense. When I read the 60% and 75% figures I thought SF JSON was slower in those percentages compared to ORG JSON. Output may be a bit faster in a future release, we have received a patch that targets a particular case.

Please feel free to send any bug/feature requests to SF JSON in order to make this issue run faster and with a lower memory usage.

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ian Boston resolved SHINDIG-451.
--------------------------------

    Resolution: Fixed

Patch applied, 
leaving the issue open pending further migration work.



> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ian Boston updated SHINDIG-451:
-------------------------------

    Attachment:     (was: SHINDIG-451.patch)

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ian Boston updated SHINDIG-451:
-------------------------------

    Attachment:     (was: SHINDIG-451.patch)

> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614693#action_12614693 ] 

Ian Boston commented on SHINDIG-451:
------------------------------------

Andres,
Thank you for the tip, I will add that in.

I am not certain if it was clear from my figures, but inspite of the  
larger message SF JSON is *faster* and has a lower GC impact than the  
ORG JSON impl.
I am going to guess that the filter you suggest will make it quicker  
still.

If you see any other glaring errors please shout.
Ian





> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHINDIG-451) JSON Serialization using net.sf.json-lib

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613847#action_12613847 ] 

Ian Boston commented on SHINDIG-451:
------------------------------------

Agreed
After sleeping on it, before removing the org.json.* version, I would  
like to validate that the net.sf.* version really is a step forwards  
in terms of GC activity and CPU. I think it will be, but numbers are  
better than hope.
So I wont include deletes in the patch just yet.





> JSON Serialization using net.sf.json-lib
> ----------------------------------------
>
>                 Key: SHINDIG-451
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-451
>             Project: Shindig
>          Issue Type: Improvement
>          Components: OpenSocial  feature (Javascript), RESTful API (Java)
>            Reporter: Ian Boston
>         Attachments: SHINDIG-451.patch
>
>
> Progress on a patch to use json-lib to perform serialization of the inbound and outbound json messages, at the moment it re-uses the rhino from Shindig 412, but only in the tests to give finer grain control in the test cases. The Enum handling in json-lib is neat :).
> The unit tests that are not currently working are disabled with a Xtest, but Person and activity with some depth in the tree are working.
> Will attache the patch in a moment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.