Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

re-enable Dag Optimizer to strip names #637

Merged
merged 2 commits into from
Nov 25, 2015
Merged

Conversation

johnynek
Copy link
Collaborator

This reverts #610 except with simpler, and much better tested code (which is to say, actual tests and tests which exposed bugs).

This adds more tests, for e.g. #633

This does not yet enable turning on all the optimizations + naming, as you have to be more careful about "irreducibles", which can change under some optimizations (namely, composing functions). But it is enough to remove the code duplication between StripNameNodes and the DagOptimizer which can do the same thing in a type-safe and general way.

I'd like to get this merged, then tackle keeping names correct under general optimizations, which I think is possible. This will dramatically simplify implementing platforms if we can successfully get the optimizations + names working correctly.

Of course, the names could control potentially optimizations (since named options can be options for optimizations), but we can deal with that down the line (probably, by passing the options into the dag optimizer).

@@ -24,147 +25,67 @@ case class ProducerF[P <: Platform[P]](oldSources: List[Producer[P, Any]],

object StripNamedNode {

def castTail[P <: Platform[P]](node: Producer[P, Any]): TailProducer[P, Any] = node.asInstanceOf[TailProducer[P, Any]]
def castToPair[P <: Platform[P]](node: Producer[P, Any]): Producer[P, (Any, Any)] = node.asInstanceOf[Producer[P, (Any, Any)]]
private def castTail[P <: Platform[P], T](node: Producer[P, T]): TailProducer[P, T] =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we've a companion class instance here, if thats the case private[this] is better for performance

@johnynek
Copy link
Collaborator Author

The storm tests are so damn flakey. We really need to solve #605

@ianoc
Copy link
Collaborator

ianoc commented Nov 25, 2015

LGTM, merge when green

johnynek added a commit that referenced this pull request Nov 25, 2015
re-enable Dag Optimizer to strip names
@johnynek johnynek merged commit 142e77d into develop Nov 25, 2015
@johnynek johnynek deleted the oscar/dagopt-stripnodes branch November 25, 2015 14:04
snoble pushed a commit to snoble/summingbird that referenced this pull request Sep 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants