--
You received this message because you are subscribed to the Google Groups "Universal Binary JSON (UBJSON)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to universal-binary...@googlegroups.com.
To post to this group, send email to universal-...@googlegroups.com.
Visit this group at http://groups.google.com/group/universal-binary-json.
For more options, visit https://groups.google.com/groups/opt_out.
Qianqian,Great question, while there isn't specifically a multi-dim container in UBJSON, as you pointed out an optimized array-of-arrays construct is exactly what I would recommend.
Using the new optimized container format markers you go from:[[][[][i][1][i][2][i][3][]][[][i][4][i][5][i][6][]][[][i][7][i][8][i][9][]]
[]]to[[][[][i][3][[][i][i][3][1][2][3][[][i][i][3][4][5][6][[][i][i][3][7][8][9]
Obviously in this contrived example you don't save much in space (but as your payloads in each dimensional array grows, your savings approaches 50%) -- in the outer array you use '[' to indicate an array marker and provide a size to help make parsing more optimal.Hope that helps!Best wishes,Riyad
On Tue, Aug 20, 2013 at 9:00 PM, Qianqian Fang <fan...@gmail.com> wrote:
hi Ryiadthanks for the effort of developing the UBJSON specifications. I am working on a MATLAB implementation of your specification, as part of my JSONLAB library (http://iso2mesh.sf.net/cgi-bin/index.cgi?jsonlab). I am wondering if you have any plans supporting multi-dimensional arrays in the optimized (compact) form?I understand that JSON itself already supports multi-dimensional arrays by nesting [] constructs. However, for binary data, this means I have to insert the '[]' notations between binary streams. This takes additional space, and slows down encoding/decoding. I see you have added the "$type" and "#count" syntax for arrays. I am wondering if the count syntax can be extended to accommodate more than a 1D horizontal vector?If this is on you roadmap, I do have a proposal, how does the following format look to you?[[] [$] [type] [#] [[] [$] [an integer type] [nx ny nz ...] []] [nx*ny*nz*sizeof(type) ] []]basically, I'd like to put a 1D dimension array (of integer type [iIlL]) after the # notation. This way, the dimensional array can be used to pre-allocate the buffer. This will help tremendously especially when handling N-D arrays in matlab.please let me know if you see any problem with this proposal. thanksQianqian
--
You received this message because you are subscribed to the Google Groups "Universal Binary JSON (UBJSON)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to universal-binary-json+unsub...@googlegroups.com.
Obviously in this contrived example you don't save much in space (but as your payloads in each dimensional array grows, your savings approaches 50%) -- in the outer array you use '[' to indicate an array marker and provide a size to help make parsing more optimal.
Hope that helps!Best wishes,Riyad
On Tue, Aug 20, 2013 at 9:00 PM, Qianqian Fang <fan...@gmail.com> wrote:
hi Ryiadthanks for the effort of developing the UBJSON specifications. I am working on a MATLAB implementation of your specification, as part of my JSONLAB library (http://iso2mesh.sf.net/cgi-bin/index.cgi?jsonlab). I am wondering if you have any plans supporting multi-dimensional arrays in the optimized (compact) form?I understand that JSON itself already supports multi-dimensional arrays by nesting [] constructs. However, for binary data, this means I have to insert the '[]' notations between binary streams. This takes additional space, and slows down encoding/decoding. I see you have added the "$type" and "#count" syntax for arrays. I am wondering if the count syntax can be extended to accommodate more than a 1D horizontal vector?If this is on you roadmap, I do have a proposal, how does the following format look to you?[[] [$] [type] [#] [[] [$] [an integer type] [nx ny nz ...] []] [nx*ny*nz*sizeof(type) ] []]basically, I'd like to put a 1D dimension array (of integer type [iIlL]) after the # notation. This way, the dimensional array can be used to pre-allocate the buffer. This will help tremendously especially when handling N-D arrays in matlab.please let me know if you see any problem with this proposal. thanksQianqian
--
You received this message because you are subscribed to the Google Groups "Universal Binary JSON (UBJSON)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to universal-binary-json+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to universal-binary...@googlegroups.com.
Qianqian,Very sorry for the delay in responding, we had a baby yesterday. I will respond to your posts shortly.
Qianqian,So sorry for the delay, finally getting back to this...
The suggestion is very cool and wonderfully optimized for multi-dim/binary structures. That said, it introduces a too-specialized data structure to the spec.Right now everything in UBJSON has a nice, compatible 1:1 mapping with something in JSON such that you can go UBJSON to JSON and back to UBJSON and get the same constructs. With this structure when you went to JSON you'd end up with array of arrays and back to UBJSON again you'd get a different construct.
Also the complexity of the construct makes my spidy-senses tingle.That said, if UBJSON was a custom binary format and needed a hyper optimized data struct like this, I'd be all over this change ;)