-
Notifications
You must be signed in to change notification settings - Fork 13
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
Suggestion for Node's data constructors #13
Comments
Thanks. I have an open TODO item also for going to |
Benchmarks are in! The old code (using Lists and less bangs):
The new code (using Vectors and more bangs):
|
It seems that Vectors and more bangs made the code slower! Maybe the real benefit of this approach shows when using also some INLINE pragmas -- which I have no experience with. Could anyone explain why it got slower? |
I've pushed the changes to a branch: https://github.com/cies/htoml/tree/improve-performance So we can all have a look at the same code. |
@andrewthad So I had a look at it again, and I guess is that either my benchmark suite is inadequate (very possible, as I never put much thought into it), or the implementation with Vector is somehow slower. |
You probably didn't see any increase in speed because your benchmarks only measure parsing speed. And parsing the content into vectors isn't really any faster because the code the If your had other benchmarks that measured the time it took to render a |
Since it is in line with how Aeson does it --and that had quite a few eyes-- I'll merge it in and release 1.0 + push to Stackage. Thanks @andrewthad ! We can later maybe tune some things up with UNPACKs or INLINEs -- but that won't affect the pub-API. |
The
Value
data type is currently defined:The bangs are inconsistent. I would recommend putting them on all of them, as
aeson
does. Also, like in aeson, I would recommend changingVArray
andVTArray
to useVector
s instead of lists. This tends to be more performant, although I don't have any benchmarks to verify this.The text was updated successfully, but these errors were encountered: