GitHub user okram opened a pull request:

    https://github.com/apache/tinkerpop/pull/349

    TINKERPOP-1349: RepeatUnrollStrategy should unroll loops while maintaining 
equivalent semantics.

    https://issues.apache.org/jira/browse/TINKERPOP-1349
    
    `RepeatUnrollStrategy` is a Standard-only strategy that will unroll a 
`repeat()` into a linear form if and only if it has a known loop amount (e.g. 
`times(2)`). That is `repeat(out()).times(2)` becomes 
`out().barrier().out().barrier()`. The `barrier()` insertions are necessary as 
`repeat()` itself is a barrier step and also, the benefit of bulking is 
leveraged. `RepeatUnrollStrategy` removes the need for `RepeatStep`, 
`RepeatEndStep`, and `LoopTraversal`.
    
    `RepeatUnrollStrategyTest` ensures that unrolling is faster than 
not-unrolling. Here are some runtimes. The first item in the Pair is the 
runtime and the second item is the amount of unique objects being processed. 
With more unique objects, the faster it gets. Note that at 10 unique elements 
(tiny traversal), sometimes rolled is faster than unrolled and vice versa (i.e. 
they are equal).
    
    ```
    rolled:[0.22843720299999998, 10]    unrolled:[0.174451055, 10]
    rolled:[0.514145509, 100]           unrolled:[0.212532769, 100]
    rolled:[1.4944357259999999, 1000]   unrolled:[0.441714987, 1000]
    rolled:[28.502658626, 10000]                unrolled:[12.936112649999998, 
10000]
    ```
    
    
    
    Also in this ticket, I fixed a bug in `BranchStep` where children were not 
being integrated and thus, susceptible to clone-problems. Moreover, I added a 
timing test to `IdentityRemovalStrategyTest`. @spmallette, do you know how to 
make a test run once and only once in a `Parameterized` test case? If so, can 
you update `IdentityRemoveStrategyTest` and `RepeatUnrollStrategyTest` 
accordingly?
    
    ---
    
    ```
    CHANGELOG
    
    * Added `RepeatUnrollStrategy` to linearize a `repeat()`-traversal if loop 
amount is known at compile time.
    * Fixed a bug in `BranchStep` around child integration during `clone()`.
    ```
    
    VOTE +1.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1349

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/349.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #349
    
----
commit 8753366a975101ba4edaa1888163abda3238f7ff
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-06-28T16:44:32Z

    added RepeatUnrollStrategy for when the loop amount is known at compile 
time. Fixed a bug in BranchStep around child integration.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to