[ 
https://jira.jboss.org/browse/SEAMREMOTING-4?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevin Galligan updated SEAMREMOTING-4:
--------------------------------------

    Attachment: Final_seam_stuff_2.patch


First shot at reducing XML size.  Changes are as follows:
- Most tag names are significantly shorter.  That includes types and structural 
tags (bean, map, number, element, member, etc).  Where possible, they are 1 or 
2 letters.
- Members of beans are listed in alphabetical order instead of using the 'name' 
attribute.  On the client side, the metadata is used to inflate the data 
objects.  This significantly cuts down on data size for larger object graphs, 
but introduces a major potential issue discussed below.
- The tag names for the simple types are shortened, and I defined them in one 
place in the code which is dynamically generated in the Remote servlet.  This 
was to simply to make that clearer and easier to change in the short term.  
Once the structure is set, they could be put directly into the JS again.
- Some remote.js changes.  The type handling/registration code between DTO 
types and components had some duplication, so I rolled that into a single 
object, but kept the original method names in case somebody had redefined them. 
 That could be trimmed in the future.

Potential issue.  If the interface js file is cached, and the object model 
changes, the positional member resolution will fail badly.  Still need to sort 
that out.  The file size savings are significant, however, so we should figure 
that out.

We did some light testing locally and our data size was cut down to about 34% 
of the original.  We could squeeze out a bit more by cutting down the tag names 
at the top (envelope, header, conversationId, etc).  Its relatively small, 
though.  The other place to cut would be the bean type names, but that would 
have required some real changes to how the API worked that I didn't want to get 
into.

I also changed the interface file generation.  This actually saves quite a bit. 
 Our major interface file is cut back to 20% of the original size, from about 
75k to 15k.  It uses the metadata to build pretty much everything, including 
declaring the fields and getter/setter methods.

In the current interface file there is a minor bug.  Sort of a bug, anyway.  It 
works, but its incorrect.  The getter/setter methods are defined on the 
prototype, but the are defined each time the constructor is called.  It works, 
but the prototype methods really only need to be defined once.  Running that 
each time is just adding some proc overhead.

> Optimize Seam Remoting XML Marshalling
> --------------------------------------
>
>                 Key: SEAMREMOTING-4
>                 URL: https://jira.jboss.org/browse/SEAMREMOTING-4
>             Project: Seam Remoting
>          Issue Type: Feature Request
>            Reporter: Joshua Davis
>            Assignee: Shane Bryzak
>             Fix For: 3.0.0.CR1
>
>         Attachments: Final_seam_stuff_2.patch
>
>
> The XML marshalling used by Seam Remoting can be optimized significantly by 
> making a few, relatively simple, changes.
> 1. Making some element names shorter, specifically 'member'.
> 2. Resolving object fields by position instead of by name.  This eliminates 
> the need for the 'name' attribute of the 'member' element.
> 3. Handling nulls pointers in structures in a simpler way: Use an empty 
> 'member' element.
> 4. Removing some of the wrapper elements around primitive types.
> In our examples we've seen that the optimized XML is less than 40% of the 
> size of the original XML.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
seam-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-issues

Reply via email to