feat: Use IEnumerable in WriteApi to eliminate unnecessary memory all…#615
Conversation
|
Sorry for the long delay in updating this PR. I've attempted to run the test suit but most the tests fail on |
|
Can you check that the InfluxDB 2 is running on the port 9999 by: |
bednar
left a comment
There was a problem hiding this comment.
Thanks for your PR 👍
Please satisfy following code formatting check: https://app.circleci.com/pipelines/github/influxdata/influxdb-client-csharp/3171/workflows/0946dbc5-63a0-43f2-b57f-d82a06bdda65/jobs/13158
74b885d to
f03a38f
Compare
f03a38f to
5c457c6
Compare
|
@bednar fixed the code formatting |
|
Will this ever be merged? Or is this project dead? |

Proposed Changes
Change WriteApi to use IEnumerable for collection arguments instead of List.
Change
WriteRecords(List<string> records)toWriteRecords(IEnumerable<string> records)Calling ToList on a collection will incur a memory allocation as the data is copied to the new list. Making the argument IEnumerable means ToList doesn't need to be called and so no extra memory allocation.
Internally this will eliminate the unnecessary memory allocation in
WriteRecords(string[] record)call to ToList, and client code also won't have to make the allocation if their data isn't already in a List## ChecklistChecklist
dotnet testcompletes successfully