Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #54999

Re: Moving JSON around.

From Ron Aaron <rambamist@gmail.com>
Newsgroups comp.lang.forth
Subject Re: Moving JSON around.
Date 2017-02-19 12:12 +0200
Organization A noiseless patient Spider
Message-ID <o8bqv2$e4$1@dont-email.me> (permalink)
References <9520efbe-f7e6-46b9-a052-7c0b99b0a352@googlegroups.com> <o8bjl1$bda$1@dont-email.me> <207762ab-6662-4825-a20a-173ff426c521@googlegroups.com>

Show all headers | View raw



On 19/02/2017 10:35, Julian Fondren wrote:
> On Sunday, February 19, 2017 at 2:07:46 AM UTC-6, Ron Aaron wrote:
>> On 02/19/2017 09:37, Julian Fondren wrote:
>>> Hello clf,
>>>
>>> A lot of my recent work is with JavaScript on the frontend and, on the
>>> backend, various scripting languages. Mostly Perl. Mostly the backend
>>> does very little work:
>>>
>>>   1. PUT a JSON object to a server
>>>   2. receive JSON object from server, in reply
>>>   3. clean the object up a bit, maybe aggregate it with other fetched
>>>      data, and write it to a file
>>>   4. (later:) a webpage's javascript fetches the file
>>>
>>> Why not do this with Forth, I wondered.
>>
>> 8th has native JSON support, so doing this is almost trivial.  In fact,
>> I just wrote a CGI script to handle logging using JSON, for a client's
>> application.
> 
> Aye, I saw your post about POSTing a JSON request to a URL. That's
> much like what I've been doing.
> 
> How does 8th compare to Perl on parsing and dumping that huge JSON file?

That depends :)

The naive "just do it" approach works, but it takes a whopping 143.6
seconds.  The reason for that is that 8th is made to use less memory to
begin with, so it keeps allocating more pools for data to be stored.

The smart "I know I'll use lots of data" approach takes 3.78 seconds.
What's a good Perl script to compare with?

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-18 23:37 -0800
  Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-19 10:07 +0200
    Re: Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-19 00:35 -0800
      Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-19 12:12 +0200
        Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-19 13:17 +0200
          Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-19 13:33 +0200
            Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-19 16:25 +0200
              Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-20 11:57 +0200
                Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-20 02:03 -0800
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-20 12:56 +0200
                Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-21 16:18 -0800
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-22 06:39 +0200
                Re: Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-24 22:36 -0800
                Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-25 01:50 -0800
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-25 20:02 +0200
                Re: Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-25 23:13 -0800
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-26 10:13 +0200
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-26 13:01 +0200
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-26 16:05 +0200
  Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-19 01:05 -0800
    Re: Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-19 01:17 -0800
      Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-19 01:38 -0800
        Re: Moving JSON around. franck.bensusan@gmail.com - 2017-02-19 16:08 -0800
          Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-19 17:16 -0800
          Re: Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-19 17:52 -0800
            Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-20 07:26 +0200
            Re: Moving JSON around. franck.bensusan@gmail.com - 2017-02-20 03:01 -0800

csiph-web