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

[FEATURE] Optimise chained transformations #22

Open
Gondolav opened this issue Jan 1, 2022 · 5 comments
Open

[FEATURE] Optimise chained transformations #22

Gondolav opened this issue Jan 1, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@Gondolav
Copy link
Member

Gondolav commented Jan 1, 2022

Describe the solution you'd like
We should optimise chained transformations in a similar way as what Apache Spark does: they should be lazy and re-ordered so that transformations reducing the number of elements are always executed first.

@Gondolav Gondolav added the enhancement New feature or request label Jan 1, 2022
@samuelchassot
Copy link
Collaborator

That's a good idea. Do you have any clues about how we would be able to get the information that calls are being chained?

@Gondolav
Copy link
Member Author

Gondolav commented Jan 2, 2022

We could instantiate an object that keeps track in a dict of what methods have been called whenever we call a transformation, re-orders them and executes them. For example if we do list.map(...).filter(...) the map instantiates the object, that records the map operation. Then, it stores filter as well, re-orders the operation to run filter first, then runs them.

@samuelchassot
Copy link
Collaborator

Mmhh yes sounds good! Just, how do you know when the last call occurs to execute them all?

@Gondolav
Copy link
Member Author

Gondolav commented Jan 2, 2022

I guess here's why Spark has transformations and actions haha

We could do the same, but I don't like it very much

@samuelchassot
Copy link
Collaborator

haha most probably ^^

Without doing something of the sort, I don't really see yet how we could do it... I'll think about it but my intuition is that we can't without either manipulate AST or having explicit call to execute transformations

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

No branches or pull requests

2 participants