Another Approach to Decoding JSON?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Another Approach to Decoding JSON?

Sprague, Gary
Hi all.

Just wanted to share some work that I've done to speed up the JSON decoding.  I have a work need to decode JSON data and found the Lasso 8.6 decoding a bit slow.

I know that James Harvard was working on improving JSON encoding, but didn't hear much about the decoding end.

Anyway, I need to decode several JSON objects hourly and found the particular payload running about 5 seconds per decode.  I was able to shorten that to 265ms with the following approach.

   define_tag('DecodeJSON',
        -required = 'JSON');
        local('_return'='');
        if(#JSON != '');
            #JSON->replace(regexp(-find='([^\\\\]{1})\'',-replace='\\1\\\\\''));
            #JSON->replace(regexp(-find='([^\\\\]{1}\")\\s*:',-replace='\\1='<smb://s*:',-replace='//1='>));
            #JSON->replace(regexp(-find='([^\\\\]{1})""',-replace='\\1\'\'')); //Here we replace empty strings in quotes
            #JSON->replace(regexp(-find='([^\\\\]{1})"',-replace='\\1\'')); //Here replace individual quotes around strings
            #JSON->replace(regexp(-find='(^|[^\\\\]{1})\\{',-replace='\\1map('));
            #JSON->replace(regexp(-find='(^|[^\\\\]{1})\\[',-replace='\\1array('))<smb://[',-replace='//1array('))>;
            #JSON->replace(regexp(-find='([^\\\\]{1})\\]',-replace='\\1<smb://]',-replace='//1>)'));
            #JSON->replace(regexp(-find='([^\\\\]{1})\\}',-replace='\\1)'));
            process('[local(\'_return\' = ' + #JSON + ')]');
        /if;
        return(#_return);
    /define_tag;

I expect peer review will point out that I'm not cleaning up date formats or handling UTF-16 or UTF-32 nor is there any error handling here, but it does work pretty fast.

Given that the JSON objects and arrays are basically Lasso maps and arrays, with slightly different syntax, regular expression replaces seemed natural.

I used the RFC on the subject to guide:  http://www.ietf.org/rfc/rfc4627.txt?number=4627

Feedback welcome!

Gary Sprague
TV Systems Engineer
HSN, 1 HSN Drive, St. Petersburg, FL 33729
Office 727.872.4489
[hidden email]<mailto:[hidden email]>

#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Another Approach to Decoding JSON?

stevepiercy
Hi Gary,

Do you have JSON samples that you can share which you used in
your testing?

Did any of your samples use nested JSON data structures?  A good
one for testing is available from the Twitter API.
https://dev.twitter.com/rest/reference/get/statuses/user_timeline

I would suggest adding comments to each regular expression to
explain its intent.

--steve


On 10/2/14 at 11:24 PM, [hidden email] (Sprague, Gary) pronounced:

>Hi all.
>
>Just wanted to share some work that I've done to speed up the
>JSON decoding.  I have a work need to decode JSON data and
>found the Lasso 8.6 decoding a bit slow.
>
>I know that James Harvard was working on improving JSON
>encoding, but didn't hear much about the decoding end.
>
>Anyway, I need to decode several JSON objects hourly and found
>the particular payload running about 5 seconds per decode.  I
>was able to shorten that to 265ms with the following approach.
>
>define_tag('DecodeJSON',
>-required = 'JSON');
>local('_return'='');
>if(#JSON != '');
>#JSON->replace(regexp(-find='([^\\\\]{1})\'',-replace='\\1\\\\\''));
>
>#JSON->replace(regexp(-find='([^\\\\]{1}\")\\s*:',-replace='\\1='<smb://s*:',-replace='/
>/1='>));
>#JSON->replace(regexp(-find='([^\\\\]{1})""',-replace='\\1\'\''));
>//Here we replace empty strings in quotes
>#JSON->replace(regexp(-find='([^\\\\]{1})"',-replace='\\1\''));
>//Here replace individual quotes around strings
>#JSON->replace(regexp(-find='(^|[^\\\\]{1})\\{',-replace='\\1map('));
>
>#JSON->replace(regexp(-find='(^|[^\\\\]{1})\\[',-replace='\\1array('))<smb://[',-replace
>='//1array('))>;
>
>#JSON->replace(regexp(-find='([^\\\\]{1})\\]',-replace='\\1<smb://]',-replace='//1>)'));
>#JSON->replace(regexp(-find='([^\\\\]{1})\\}',-replace='\\1)'));
>process('[local(\'_return\' = ' + #JSON + ')]');
>/if;
>return(#_return);
>/define_tag;
>
>I expect peer review will point out that I'm not cleaning up
>date formats or handling UTF-16 or UTF-32 nor is there any
>error handling here, but it does work pretty fast.
>
>Given that the JSON objects and arrays are basically Lasso maps
>and arrays, with slightly different syntax, regular expression
>replaces seemed natural.
>
>I used the RFC on the subject to guide:  http://www.ietf.org/rfc/rfc4627.txt?number=4627
>
>Feedback welcome!
>
>Gary Sprague
>TV Systems Engineer
>HSN, 1 HSN Drive, St. Petersburg, FL 33729
>Office 727.872.4489
>[hidden email]<mailto:[hidden email]>
>
>#############################################################
>Attend the Lasso Developer Conference 2014!
>October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
>http://www.lassosoft.com/LDC-newmarket-2014
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>

#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Another Approach to Decoding JSON?

Sprague, Gary
In reply to this post by Sprague, Gary
Steve,

I can't share my employers internal JSON data that I was testing with, but I did take your advice and looked at the Twitter API site.  I did not spend the time to get OAUTH set up so that I could pull a feed, but did copy their sample data.  It was malformed (according to JSONLint) but I corrected it and tested.

Also, I found that my code sample got messed up somewhere in the email chain so the code example is not as intended.

I tried replying to you last night via the LassoTalk site, but apparently it didn't make it back out, so I'm replying via email this morning.

I have made some additional changes and put together a one page sample that you can test with.

You can find the page here:  http://www.gareworks.com/decode_json.lasso

Also, I found more JSON samples from JSON.org here: http://json.org/example
and here: http://www.json-generator.com/#

I have some things to work out with the regex, but I have a working model that is pretty promising.

--Gary
________________________________________
Date: Thu,  2 Oct 2014 17:21:28 -0700
From: Steve Piercy - Website Builder <[hidden email]>
To: [hidden email]
Subject: Re: Another Approach to Decoding JSON?
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset=UTF-8; format=flowed

Hi Gary,

Do you have JSON samples that you can share which you used in
your testing?

Did any of your samples use nested JSON data structures?  A good
one for testing is available from the Twitter API.
https://dev.twitter.com/rest/reference/get/statuses/user_timeline

I would suggest adding comments to each regular expression to
explain its intent.

--steve


On 10/2/14 at 11:24 PM, [hidden email] (Sprague, Gary) pronounced:

>Hi all.
>
>Just wanted to share some work that I've done to speed up the
>JSON decoding.  I have a work need to decode JSON data and
>found the Lasso 8.6 decoding a bit slow.
>
>I know that James Harvard was working on improving JSON
>encoding, but didn't hear much about the decoding end.
>
>Anyway, I need to decode several JSON objects hourly and found
>the particular payload running about 5 seconds per decode.  I
>was able to shorten that to 265ms with the following approach.
>
>define_tag('DecodeJSON',
>-required = 'JSON');
>local('_return'='');
>if(#JSON != '');
>#JSON->replace(regexp(-find='([^\\\\]{1})\'',-replace='\\1\\\\\''));
>
>#JSON->replace(regexp(-find='([^\\\\]{1}\")\\s*:',-replace='\\1='<smb://s*:',-replace='/
>/1='>));
>#JSON->replace(regexp(-find='([^\\\\]{1})""',-replace='\\1\'\''));
>//Here we replace empty strings in quotes
>#JSON->replace(regexp(-find='([^\\\\]{1})"',-replace='\\1\''));
>//Here replace individual quotes around strings
>#JSON->replace(regexp(-find='(^|[^\\\\]{1})\\{',-replace='\\1map('));
>
>#JSON->replace(regexp(-find='(^|[^\\\\]{1})\\[',-replace='\\1array('))<smb://[',-replace
>='//1array('))>;
>
>#JSON->replace(regexp(-find='([^\\\\]{1})\\]',-replace='\\1<smb://]',-replace='//1>)'));
>#JSON->replace(regexp(-find='([^\\\\]{1})\\}',-replace='\\1)'));
>process('[local(\'_return\' = ' + #JSON + ')]');
>/if;
>return(#_return);
>/define_tag;
>
>I expect peer review will point out that I'm not cleaning up
>date formats or handling UTF-16 or UTF-32 nor is there any
>error handling here, but it does work pretty fast.
>
>Given that the JSON objects and arrays are basically Lasso maps
>and arrays, with slightly different syntax, regular expression
>replaces seemed natural.
>
>I used the RFC on the subject to guide:  http://www.ietf.org/rfc/rfc4627.txt?number=4627
>
>Feedback welcome!
>
>Gary Sprague
>TV Systems Engineer
>HSN, 1 HSN Drive, St. Petersburg, FL 33729
>Office 727.872.4489
>[hidden email]<mailto:[hidden email]>
>
>#############################################################
>Attend the Lasso Developer Conference 2014!
>October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
>http://www.lassosoft.com/LDC-newmarket-2014
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>
#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Another Approach to Decoding JSON?

Jolle Carlestam-2
In reply to this post by Sprague, Gary
2 okt 2014 kl. 19:24 skrev Sprague, Gary <[hidden email]>:

> Just wanted to share some work that I've done to speed up the JSON decoding.  I have a work need to decode JSON data and found the Lasso 8.6 decoding a bit slow.

For those of you not at LDC. Lasso 9.3 comes with some highly optimized json methods. They are several times faster than the existing methods.
So, if you use 9.3 there’s no need to try to improve the json handling. Lassosoft (Kyle) has done the job for you.

HDB
Jolle
#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Another Approach to Decoding JSON?

Kyle Jessup-2

On Oct 3, 2014, at 7:24 AM, Jolle Carlestam <[hidden email]> wrote:

> 2 okt 2014 kl. 19:24 skrev Sprague, Gary <[hidden email]>:
>
>> Just wanted to share some work that I've done to speed up the JSON decoding.  I have a work need to decode JSON data and found the Lasso 8.6 decoding a bit slow.
>
> For those of you not at LDC. Lasso 9.3 comes with some highly optimized json methods. They are several times faster than the existing methods.
> So, if you use 9.3 there’s no need to try to improve the json handling. Lassosoft (Kyle) has done the job for you.

The code for which is in our open repo.

http://source.lassosoft.com/svn/lasso/lasso9_source/trunk/

json_encode.lasso, json_decode.lasso

Sample usage at the bottom of each.
-Kyle

>
> HDB
> Jolle
> #############################################################
> Attend the Lasso Developer Conference 2014!
> October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
> http://www.lassosoft.com/LDC-newmarket-2014
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Another Approach to Decoding JSON?

Sprague, Gary
In reply to this post by Sprague, Gary
Jolle,

I'm still on Lasso 8.6 and will be for the foreseeable future.  I have a significant codebase already established and by looking at Lasso 9 code it would take me a significant amount of time to port my code over.

For my purposes, the 15x speed increase in the way I'm approaching it works for me.

--Gary


On Oct 3, 2014, at 7:24 AM, Jolle Carlestam <[hidden email]<mailto:[hidden email]>> wrote:

> 2 okt 2014 kl. 19:24 skrev Sprague, Gary <[hidden email]<mailto:[hidden email]>>:
>
>> Just wanted to share some work that I've done to speed up the JSON decoding. I have a work need to decode JSON data and found the Lasso 8.6 decoding a bit slow.
>
> For those of you not at LDC. Lasso 9.3 comes with some highly optimized json methods. They are several times faster than the existing methods.
> So, if you use 9.3 there=92s no need to try to improve the json handling. Lassosoft (Kyle) has done the job for you.

The code for which is in our open repo.

http://source.lassosoft.com/svn/lasso/lasso9_source/trunk/

json_encode.lasso, json_decode.lasso

Sample usage at the bottom of each.
-Kyle

Gary Sprague
TV Systems Engineer
HSN, 1 HSN Drive, St. Petersburg, FL 33729
Office 727.872.4489
[hidden email]<mailto:[hidden email]>
#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Another Approach to Decoding JSON?

stevepiercy
In reply to this post by Kyle Jessup-2
On 10/3/14 at 10:16 AM, [hidden email] (Kyle Jessup) pronounced:

> On Oct 3, 2014, at 7:24 AM, Jolle Carlestam <[hidden email]> wrote:
>
> > 2 okt 2014 kl. 19:24 skrev Sprague, Gary <[hidden email]>:
> >
> >> Just wanted to share some work that I've done to speed up the JSON decoding.  I have
> a work need to decode JSON data and found the Lasso 8.6 decoding a bit slow.
> >
> > For those of you not at LDC. Lasso 9.3 comes with some highly optimized json methods.
> They are several times faster than the existing methods.
> > So, if you use 9.3 there’s no need to try to improve the json handling. Lassosoft
> (Kyle) has done the job for you.
>
> The code for which is in our open repo.
>
> http://source.lassosoft.com/svn/lasso/lasso9_source/trunk/
>
> json_encode.lasso, json_decode.lasso
>
> Sample usage at the bottom of each.

Will this code be back ported to Lasso 8.6 by LassoSoft, and included in a future update?

--steve


> -Kyle
>
> >
> > HDB
> > Jolle
> > #############################################################
> > Attend the Lasso Developer Conference 2014!
> > October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
> > http://www.lassosoft.com/LDC-newmarket-2014
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >  the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
> #############################################################
> Attend the Lasso Developer Conference 2014!
> October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
> http://www.lassosoft.com/LDC-newmarket-2014
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>

#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Another Approach to Decoding JSON?

Sprague, Gary
Steve,

I wouldn't expect Lasso to go backwards to support 8.6 as they would like us all to move forward to Lasso 9, and I completely understand that.

With that being said, I will likely fill in the gap for us 8.5 and 8.6 users by adding replacement tags to TagSwap once I've done a little more testing.

I have made significant strides in the past few days (since my original post) to optimize my own code and ensure that things don't break.

I have updated the demo page with a larger json data sample and added more comments  to the documentation.  (you'll see the code once you press submit).

I am now seeing parsing times that are on average between 20 and 30 times faster, depending on how many nodes and whether there is any string values that need further escaping.

Feel free to check it out at:
 http://www.gareworks.com/decode_json.lasso

and let me know if you find a way to break it. :)

Gary Sprague
TV Systems Engineer
HSN, 1 HSN Drive, St. Petersburg, FL 33729
Office 727.872.4489
[hidden email]<mailto:[hidden email]>

On Oct 3, 2014, at 5:05 PM, Steve Piercy - Website Builder <[hidden email]<mailto:[hidden email]>> wrote:

On 10/3/14 at 10:16 AM, [hidden email]<mailto:[hidden email]> (Kyle Jessup) pronounced:

On Oct 3, 2014, at 7:24 AM, Jolle Carlestam <[hidden email]<mailto:[hidden email]>> wrote:

2 okt 2014 kl. 19:24 skrev Sprague, Gary <[hidden email]<mailto:[hidden email]>>:

Just wanted to share some work that I've done to speed up the JSON decoding.  I have
a work need to decode JSON data and found the Lasso 8.6 decoding a bit slow.

For those of you not at LDC. Lasso 9.3 comes with some highly optimized json methods.
They are several times faster than the existing methods.
So, if you use 9.3 there’s no need to try to improve the json handling. Lassosoft
(Kyle) has done the job for you.

The code for which is in our open repo.

http://source.lassosoft.com/svn/lasso/lasso9_source/trunk/

json_encode.lasso, json_decode.lasso

Sample usage at the bottom of each.

Will this code be back ported to Lasso 8.6 by LassoSoft, and included in a future update?

--steve


-Kyle


HDB
Jolle
#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>

#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
 the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]<mailto:[hidden email]>>               <http://www.StevePiercy.com/>

#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
 the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>

#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Another Approach to Decoding JSON?

stevepiercy
Hi Gary,

I would suggest creating a repository on GitHub (or similar free
service) to post your code and tests so that it is easier to
collaborate.  I have some documentation in the Knop Project repo
on GitHub for how to get started with git and GitHub, if you're
not familiar with it.
https://github.com/knop-project/knop/tree/master/docs

--steve


On 10/7/14 at 4:13 PM, [hidden email] (Sprague, Gary) pronounced:

>Steve,
>
>I wouldn't expect Lasso to go backwards to support 8.6 as they
>would like us all to move forward to Lasso 9, and I completely
>understand that.
>
>With that being said, I will likely fill in the gap for us 8.5
>and 8.6 users by adding replacement tags to TagSwap once I've
>done a little more testing.
>
>I have made significant strides in the past few days (since my
>original post) to optimize my own code and ensure that things
>don't break.
>
>I have updated the demo page with a larger json data sample and
>added more comments  to the documentation.  (you'll see the
>code once you press submit).
>
>I am now seeing parsing times that are on average between 20
>and 30 times faster, depending on how many nodes and whether
>there is any string values that need further escaping.
>
>Feel free to check it out at:
>http://www.gareworks.com/decode_json.lasso
>
>and let me know if you find a way to break it. :)
>
>Gary Sprague
>TV Systems Engineer
>HSN, 1 HSN Drive, St. Petersburg, FL 33729
>Office 727.872.4489
>[hidden email]<mailto:[hidden email]>
>
>On Oct 3, 2014, at 5:05 PM, Steve Piercy - Website Builder
><[hidden email]<mailto:[hidden email]>> wrote:
>
>On 10/3/14 at 10:16 AM,
>[hidden email]<mailto:[hidden email]> (Kyle Jessup) pronounced:
>
>On Oct 3, 2014, at 7:24 AM, Jolle Carlestam
><[hidden email]<mailto:[hidden email]>> wrote:
>
>2 okt 2014 kl. 19:24 skrev Sprague, Gary <[hidden email]<mailto:[hidden email]>>:
>
>Just wanted to share some work that I've done to speed up the JSON decoding.  I have
>a work need to decode JSON data and found the Lasso 8.6 decoding a bit slow.
>
>For those of you not at LDC. Lasso 9.3 comes with some highly optimized json methods.
>They are several times faster than the existing methods.
>So, if you use 9.3 there’s no need to try to improve the json handling. Lassosoft
>(Kyle) has done the job for you.
>
>The code for which is in our open repo.
>
>http://source.lassosoft.com/svn/lasso/lasso9_source/trunk/
>
>json_encode.lasso, json_decode.lasso
>
>Sample usage at the bottom of each.
>
>Will this code be back ported to Lasso 8.6 by LassoSoft, and
>included in a future update?
>
>--steve
>
>
>-Kyle
>
>
>HDB
>Jolle
>#############################################################
>Attend the Lasso Developer Conference 2014!
>October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
>http://www.lassosoft.com/LDC-newmarket-2014
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>
>#############################################################
>Attend the Lasso Developer Conference 2014!
>October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
>http://www.lassosoft.com/LDC-newmarket-2014
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>
>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>Steve Piercy              Website Builder              Soquel, CA
><[hidden email]<mailto:[hidden email]>>               <http://www.StevePiercy.com/>
>
>#############################################################
>Attend the Lasso Developer Conference 2014!
>October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
>http://www.lassosoft.com/LDC-newmarket-2014
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>
>#############################################################
>Attend the Lasso Developer Conference 2014!
>October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
>http://www.lassosoft.com/LDC-newmarket-2014
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.StevePiercy.com/>

#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] Another Approach to Decoding JSON?

Sprague, Gary
Steve,

I started using Git this year with SourceTree as the desktop tool.  Mostly working with it for my day job, but have some side private projects that I'm going to start managing there.

Will put a public project in a few days with the current code.

I plan on seeing what I can do with the encode side of the equation as well in the future.

Gary Sprague
TV Systems Engineer
HSN, 1 HSN Drive, St. Petersburg, FL 33729
Office 727.872.4489
[hidden email]<mailto:[hidden email]>

On Oct 7, 2014, at 4:18 PM, Steve Piercy - Website Builder <[hidden email]<mailto:[hidden email]>> wrote:

Hi Gary,

I would suggest creating a repository on GitHub (or similar free service) to post your code and tests so that it is easier to collaborate.  I have some documentation in the Knop Project repo on GitHub for how to get started with git and GitHub, if you're not familiar with it.
https://github.com/knop-project/knop/tree/master/docs

--steve

#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] Another Approach to Decoding JSON?

Ke Carlton-3
An even simpler option for small snippets is gists:

https://gist.github.com || https://gist.github.com/Ke-


And one of the nice things about Github is that git is not a requirement.

Ke

On 8 October 2014 10:14, Sprague, Gary <[hidden email]> wrote:

>
> I started using Git this year with SourceTree as the desktop tool.
> Will put a public project in a few days with the current code.
>
>
#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] Another Approach to Decoding JSON?

Jolle Carlestam-2
8 okt 2014 kl. 06:23 skrev Ke Carlton <[hidden email]>:

> An even simpler option for small snippets is gists:
>
> https://gist.github.com || https://gist.github.com/Ke-

More Lasso code:
https://gist.github.com/jolle-c

HDB
Jolle
#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>