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

Reduce array copying when access is linear or affine. #27

Closed
wants to merge 3 commits into from

Conversation

HuwCampbell
Copy link
Collaborator

We elaborate immutable Core functions to avalanche and insert extra
Copy operations when updating Arrays (which are usually map ops).

This maintains correct semantics when we compile to C and have Arrays
as allocated values on the heap with pointers to them.

Unfortunately though, some of these copy operations were turning up
in our loops, which doesn't make a lot of sense, especially for
queries like

from ... in group ... in ...

We fix this by removing copy operations which can't affect the results
by tracking values which could potentially point to them and see if
a binding uses it in a non-linear manner.

We elaborate immutable Core functions to avalanche and insert extra
Copy operations when updating Arrays (which are usually map ops).

This maintains correct semantics when we compile to C and have Arrays
as allocated values on the heap with pointers to them.

Unfortunately though, some of these copy operations were turning up
in our loops, which doesn't make a lot of sense, especially for
queries like

```
from ... in group ... in ...
```

We fix this by removing copy operations which can't affect the results
by tracking values which could potentially point to them and see if
a binding uses it in a non-linear manner.
@HuwCampbell HuwCampbell force-pushed the topic/linear-array-access branch from 5ff26fa to c748c4c Compare May 5, 2024 05:17
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

Successfully merging this pull request may close these issues.

1 participant