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

Possible optimization in DbDataReader.GetStream #124

Closed
TrayanZapryanov opened this issue Jun 9, 2019 · 4 comments
Closed

Possible optimization in DbDataReader.GetStream #124

TrayanZapryanov opened this issue Jun 9, 2019 · 4 comments

Comments

@TrayanZapryanov
Copy link
Contributor

Do you think if it is worth using System.Buffers.ArrayPool instead of always allocating byte[4096] in default implementation of DbDataReader.GetStream() ?

https://github.com/dotnet/corefx/blob/46d9f33d96a1db41a9634b84dd68256db2eeed4f/src/System.Data.Common/src/System/Data/Common/DbDataReader.cs#L147

@Wraith2
Copy link
Contributor

Wraith2 commented Jun 10, 2019

Possibly, but I would expect each provider to override it with a performance tuned implementation as SqlClient does. In ths SqlClient specific case I've made some optimizations on streams already in dotnet/corefx#35927 and if there are more that can be seen from specific test cases i'll probably add them.

@TrayanZapryanov
Copy link
Contributor Author

Unfortunately neither MySQL or Oracle done it :(.

@Wraith2
Copy link
Contributor

Wraith2 commented Jun 11, 2019

Understandable if a bit sad given their owner and platform preferences. You can try https://github.com/mysql-net/MySqlConnector for mysql it isn't first party but it's modern actively developed and the authors are interested in good performance.

@TrayanZapryanov
Copy link
Contributor Author

Thank you.
I will redirect this proposal to MySQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants