Re: [racket-users] performance, json

2019-03-02 Thread Matthew Flatt
At Fri, 22 Feb 2019 16:34:24 -0500, Jon Zeppieri wrote: > On a related (but not too related) note: is there an efficient way to skip > multiple bytes in an input stream? It looks like there are two choices: > - You can read the bytes you want to skip, but that implies either > allocating a useles

Re: [racket-users] performance, json

2019-02-28 Thread Brian Craft
I added some type annotations & tried it. The result is 16s, substantially slower. Haven't tried tjson, yet. I'm not actually even that interested in json, it was just something at-hand to try. >From this thread, it sounds like there's some knowledge about racket performance that isn't yet in

Re: [racket-users] performance, json

2019-02-22 Thread WarGrey Gyoudmon Ju
I have tried my best to find the "best practice" to do Racket IO. Here are some tips I found in writing CSV reader: https://github.com/wargrey/schema/blob/master/digitama/exchange/csv/reader/port.rkt With a MacBook Pro 15, 2013, it takes 3.5s to read a 70MB file. I agreed that `read-char` is the

Re: [racket-users] performance, json

2019-02-22 Thread Jon Zeppieri
On a related (but not too related) note: is there an efficient way to skip multiple bytes in an input stream? It looks like there are two choices: - You can read the bytes you want to skip, but that implies either allocating a useless byte array or keeping one around for this very purpose. - Yo

Re: [racket-users] performance, json

2019-02-22 Thread Matthew Flatt
I think the bigger bottleneck is the main parsing loop, which uses `regexp-try-match` even more. Although `regexp-try-match` is convenient, it's much slower than using `peek-char` directly to check for one character. I'll experiment with improvements there. At 22 Feb 2019 13:36:20 -0500, "'John Cl

Re: [racket-users] performance, json

2019-02-22 Thread Greg Trzeciak
There is http://docs.racket-lang.org/tjson/index.html available (haven't checked how similar the code is though) On Friday, February 22, 2019 at 7:36:23 PM UTC+1, johnbclements wrote: > > > > … and my guess is that the JS performance would be similar, if the json > reader in JS was written in J

Re: [racket-users] performance, json

2019-02-22 Thread 'John Clements' via Racket Users
I’m not that surprised :). My guess is that our json reader could be sped up quite a bit. This looks like the heart of the read-json implementation: (define (read-json* who i jsnull) ;; Follows the specification (eg, at json.org) -- no extensions. ;; (define (err fmt . args) (define-va