Re: [Lazarus] Tests results of several pascal based JSON parsers

2019-09-02 Thread Luiz Americo Pereira Camara via lazarus
Em seg, 2 de set de 2019 às 13:24, Luiz Americo Pereira Camara <
luizameri...@gmail.com> escreveu:

>
>
> Em dom, 1 de set de 2019 às 12:37, Marco van de Voort via lazarus <
> lazarus@lists.lazarus-ide.org> escreveu:
>
>>
>> I only looked superficially, but I miss a test on a large files, only
>> files of a few kb repeated 10 times.
>>
>> The large file case is a good test for scaling of internal datastructures.
>>
>>
> Here you can find some real use json for testing, including a big one
> (1.6MB)
>
>
https://github.com/RichardHightower/json-parsers-benchmark/tree/master/data


> Luiz
>
>
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Tests results of several pascal based JSON parsers

2019-09-02 Thread Luiz Americo Pereira Camara via lazarus
Em dom, 1 de set de 2019 às 12:37, Marco van de Voort via lazarus <
lazarus@lists.lazarus-ide.org> escreveu:

>
> I only looked superficially, but I miss a test on a large files, only
> files of a few kb repeated 10 times.
>
> The large file case is a good test for scaling of internal datastructures.
>
>
Here you can find some real use json for testing, including a big one
(1.6MB)

Luiz
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Tests results of several pascal based JSON parsers

2019-09-02 Thread Sergey Bodrov via lazarus
пт, 30 авг. 2019 г. в 11:18, Anthony Walter via lazarus <
lazarus@lists.lazarus-ide.org>:

> I've posted a new page that tests the speed and correctness of several
> pascal based JSON parsers.
>
>
Thanks for testing! My JsonStorage seems to be outsider. =)

Actually, my work requires more effective serializers, such as
Protobuffers, ASN.1 or Thrift. But I shoose Bencode, it simple and almost
human-readable text, but fast and compact as binary.

Most serialization protocols use same data structures - numbers, literals,
lists and records. Pascal type Variant suitable for any data, except
records (dictionary, name-value pairs). So, if we add records to Variant,
it will become serializable/deserializabe to many protocols. Also, it can
be used to store publushed properties and used to transfer data between
different objects/classes/records, that supports RTTI.

Even without RTTI, Variants can be used to store name-value pairs as
name-indexed array, it very handy, and present in many modern programming
languages. "Variant record" can be static, initialized once, like
VarArrayCreate(), don't allow appending new name-values.


-- 
*Bodrov Sergey*
software development, IT consulting
http://www.serbod.com
*Phone (Belarus):* +375(25)794-21-58
*Skype:* sergey.bodrov1
*e-mail:* ser...@gmail.com, oxot...@yandex.ru
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Tests results of several pascal based JSON parsers

2019-09-01 Thread Marco van de Voort via lazarus

Op 2019-08-30 om 10:18 schreef Anthony Walter via lazarus:
I've posted a new page that tests the speed and correctness of several 
pascal based JSON parsers.


https://www.getlazarus.org/json/tests/

In full disclosure I am the author of the new open source JsonTools 
library, and even though my parser seems to a big improvement over the 
other alternatives, my tests were not biased.


If anyone would like help in replication the tests, let me know and 
I'll see what I can do.


Also, to be thorough, you should read through both the article I 
posted at the top this message, and my original page 
 which has been updated with more 
information. Both pages took some time to write, and I promise if you 
read through them some of your questions will be answered without 
having to ask others for help or insight.


I only looked superficially, but I miss a test on a large files, only 
files of a few kb repeated 10 times.


The large file case is a good test for scaling of internal datastructures.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Tests results of several pascal based JSON parsers

2019-08-30 Thread Michael Van Canneyt via lazarus



On Fri, 30 Aug 2019, Anthony Walter via lazarus wrote:


Alexey,

Currently JsonTools anything that is valid JSON as described on this page:

https://www.json.org/

The only valid constants are: null, true, false
Arrays can contain other arrays and object to any reasonable level
 [[[]]] //  is a valid array
 [{}{}[{}{}]] // is a valid array
Objects can contain other objects and arrays to any reasonable level
 {"a":{"a":{"a":[[]]}}} // is a valid object

I will look into you request for comment support, even though comments are
not allowed in the official specification.


And so your tool will also become more bulky and slower :)

Michael.

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Tests results of several pascal based JSON parsers

2019-08-30 Thread Anthony Walter via lazarus
Alexey,

Currently JsonTools anything that is valid JSON as described on this page:

https://www.json.org/

The only valid constants are: null, true, false
Arrays can contain other arrays and object to any reasonable level
  [[[]]] //  is a valid array
  [{}{}[{}{}]] // is a valid array
Objects can contain other objects and arrays to any reasonable level
  {"a":{"a":{"a":[[]]}}} // is a valid object

I will look into you request for comment support, even though comments are
not allowed in the official specification.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Tests results of several pascal based JSON parsers

2019-08-30 Thread Alexey Tor. via lazarus
This is very good news, that we have JsonTools parser now. I may think 
of using it in CudaText - ie replacing fpJSON to JsonTools.


About lib. 1) Pls add an option to handle // comments in json. yes, 
json don't allow this but CudaText and SublimeText and many programs 
have json configs with comments. They use libs which allow comments. 
fpJSON allows comments by option.


2) Pls add an option which allows "," after final dict node: { "a":1, 
"b":2, }


so my app can read json file with final (bad) comma after "b":2.

3) Lib must support "true", "false", "none" or "nil"(?), values like 
list [], with empty list, values like dict {}, with empty dict. And list 
inside dict etc.


Alexey Torgashin



--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Tests results of several pascal based JSON parsers

2019-08-30 Thread Anthony Walter via lazarus
I've posted a new page that tests the speed and correctness of several
pascal based JSON parsers.

https://www.getlazarus.org/json/tests/

In full disclosure I am the author of the new open source JsonTools
library, and even though my parser seems to a big improvement over the
other alternatives, my tests were not biased.

If anyone would like help in replication the tests, let me know and I'll
see what I can do.

Also, to be thorough, you should read through both the article I posted at
the top this message, and my original page 
which has been updated with more information. Both pages took some time to
write, and I promise if you read through them some of your questions will
be answered without having to ask others for help or insight.

Thanks,
Anthony
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus