octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #9980] JSON encoder and decoder, alternati


From: Kai Torben Ohlhus
Subject: [Octave-patch-tracker] [patch #9980] JSON encoder and decoder, alternative to object2json
Date: Wed, 22 Dec 2021 02:53:17 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36

Follow-up Comment #56, patch #9980 (project octave):

I follow this discussion with some interest.  @K you can test jsondecode at
any time in any Octave version using the json package:


pkg install "https://github.com/gnu-octave/pkg-json/archive/v1.5.0.tar.gz";
pkg load json


And make the experiments yourself:


>> str = fileread("numerical.json"); tic; fromJSON (str); toc, tic; jsondecode
(str); toc
Elapsed time is 4.49402 seconds.
Elapsed time is 0.136716 seconds.
>> str = fileread("numerical_small.json"); tic; fromJSON (str); toc, tic;
jsondecode (str); toc
Elapsed time is 0.00621009 seconds.
Elapsed time is 0.000169039 seconds.
>> str = fileread("dhs_keywords.json"); tic; fromJSON (str); toc, tic;
jsondecode (str); toc
Elapsed time is 0.231829 seconds.
error: jsondecode: parse error at offset 1: Invalid value.


However, jsondecode is compiled C++ code, using the fastest free JSON C++
library available today.  Any m-code can hardly compete against this, but your
code seems as good as possible using pure m-code 🙂


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?9980>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]