Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write tomland benchmarks #98

Closed
3 tasks done
chshersh opened this issue Oct 2, 2018 · 5 comments
Closed
3 tasks done

Write tomland benchmarks #98

chshersh opened this issue Oct 2, 2018 · 5 comments
Assignees
Labels
performance Benchmarks & performance optimizations

Comments

@chshersh
Copy link
Contributor

chshersh commented Oct 2, 2018

We're interested only in bechmarks for parsing (mostly because other Haskell TOML libraries don't have pretty-printing abilities) and for converting to Haskell data types (aka 2 phases). See this talk by George Wilson about CSV encoding/decoding library for multiple phases explanation:

I would like to have a comparison with the following libraries:

Also, I recommend using gauge library for the benchmarks.

@chshersh chshersh added Hacktoberfest https://hacktoberfest.digitalocean.com/ performance Benchmarks & performance optimizations labels Oct 2, 2018
@chshersh chshersh added this to To do in #2: Hacktoberfest (October, 2018) via automation Oct 2, 2018
@willbasky
Copy link
Collaborator

willbasky commented Oct 9, 2018

What functions/actions/operations to benchmark?
Parsing and converting middle state and converting to Haskell type. I see.

Do all other libraries have two step converting?

Does tomland has separate function for parsing and for converting?
decode :: TomlCodec a -> Text -> Either DecodeException a function includes both steps.

@willbasky
Copy link
Collaborator

willbasky commented Oct 9, 2018

htoml has parser step.
parseTomlDoc :: String -> Text -> Either ParseError Table where Table is HashMap with Text keys and Node as value, the last is like AnyValue in tomland.

parseOnly :: Parsec Text (Set [Text]) a -> Text -> Either ParseError a is like tomland's decode.
Thereby htoml has two steps as tomland. Is it correct?

htoml-megaparsec has the same approach.

@willbasky
Copy link
Collaborator

willbasky commented Oct 9, 2018

toml-parser and toml have just parser, without convertor. Is it correct?

@chshersh
Copy link
Contributor Author

@willbasky

What functions/actions/operations to benchmark?

I suppose we should have some TOML example file with multiple fields:

  • Bool
  • Integer
  • Text
  • DateTime
  • Array
  • Table1
  • Table2

I would like to have different types of TOML values, so we can put inside tables 1 and 2 something different. For example, if you put ZonedTIme on top-level DateTime then you can put LocalDay in table1 and just time in Table2. Same for array: you can have array of strings, array of different doubles (with nan and inf) and array of array of integers. String can be either raw or quoted or multiline string. Just some random different values to test everything.

Do all other libraries have two step converting?

Not sure. But for those, who don't have, we need to write conversion manually by our own just for this library.

Does tomland has separate function for parsing and for converting?
decode :: TomlCodec a -> Text -> Either DecodeException a function includes both steps.

tomland has separate function only for parsing:

But it doesn't have separate function only for conversion. Probably it's a good idea to have one.

So I I see the following steps to work on this issue:

  1. Add function with type like TomlCodec a -> TOML -> Either DecodeException a
  2. Implement example of TOML for the benchmarks.
  3. Write data type, that describes this example.
  4. Write parser and converter for every library separately.
  5. Combine everything with benchmarks.

I think that for every task you can create separate issue to make amount of work per issue smaller.

@willbasky
Copy link
Collaborator

willbasky commented Oct 16, 2018

@willbasky willbasky removed their assignment Oct 17, 2018
@chshersh chshersh added this to the v1.0.0: Public release milestone Oct 25, 2018
@chshersh chshersh added this to To do in #3: Hero Academia (November, 2018) via automation Nov 7, 2018
@chshersh chshersh removed the Hacktoberfest https://hacktoberfest.digitalocean.com/ label Nov 7, 2018
@willbasky willbasky self-assigned this Nov 11, 2018
#3: Hero Academia (November, 2018) automation moved this from To do to Done: Issues Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Benchmarks & performance optimizations
Projects
No open projects
Development

No branches or pull requests

2 participants