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

Implement non-copying result access #17

Open
zmj opened this issue May 22, 2019 · 1 comment
Open

Implement non-copying result access #17

zmj opened this issue May 22, 2019 · 1 comment
Assignees

Comments

@zmj
Copy link
Owner

zmj commented May 22, 2019

The current query execution is basically:

foreach (var row in query.Execute) {
    row.AssignTo(out var result); // copy from SQLite memory to managed memory
    // do anything with result, including putting it on the heap
}

This can be optimized for callers that only use the result on the stack. Maybe:

query.Execute.ForEach(result => StackWork(result)) // no copy, Span fields allowed

Where result is constrained to ref struct?

@zmj zmj self-assigned this May 22, 2019
@zmj
Copy link
Owner Author

zmj commented May 27, 2019

Generics over spans / ref structs aren't currently possible: dotnet/csharplang#1148

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

1 participant