-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Output adapters should be templated. #2172
Comments
Welp, looks like Output Iterators are going to be an issue here: http://quick-bench.com/i9aGfwlqjxVfsgAsjb_jHEYDaSU I was kinda hoping that the exponential allocation increase would lead to a lot less copying, but it seems that this only becomes relevant after 10s of millions of insertions... We could always add overloads for types that support multiple insertions at once, like So the interface would be:
Where
( The next question is: Given that this duck-typed API will be required, is there any reason to still support |
Was the legacy output interface actually usable externally? I didn't think it was. I'm not sure I follow -- above you state that by accepting LegacyOutputIterator, we can accept arbitrary user-sinks (a highly desired feature, IMO). But at the bottom you ask if we need to support LegacyOutputIterator at all? Are you simply saying that via duck-typing the user can insert their own adapter, thus we get our customizable functionality, and providing a legacy binding isn't necessary? |
My original proposal was to add support for However, as I started investigating, I discovered that it's not possible to achieve the current performance while using So, we definitely have a need for something else than |
I see... I thought LegacyOutputIterator was just glue to support the old output adapter interface that's in the library already. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Which feature do you want to see in the library?
While input adapters have been refactored to ditch polymorphism and add support for user-defined iterators, the output part of the system has remained the same. I propose that similar changes can be done there.
There is at least some evidence that having a faster encoding time would be desirable, so this would not be just a matter of increasing consistency within the codebase:
Originally posted by @abrownsword in #1457 (comment)
This would involve:
Bonus:
value_type
when dumping a non-binary format. (probably through a separate PR)How would the feature be usable for other users?
For this, I suggest adding a the following method to
basic_json
:Which would be used like so:
The text was updated successfully, but these errors were encountered: