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

Select choice filters should be as fast as other XPath predicates #5694

Closed
seadowg opened this issue Jul 26, 2023 · 0 comments · Fixed by getodk/javarosa#722
Closed

Select choice filters should be as fast as other XPath predicates #5694

seadowg opened this issue Jul 26, 2023 · 0 comments · Fixed by getodk/javarosa#722
Assignees
Milestone

Comments

@seadowg
Copy link
Member

seadowg commented Jul 26, 2023

The same complexity profiles that we ended up with for getodk/javarosa#689 should apply for selects with choice filters.

An example test that shows this is not the case is:

Scenario scenario = Scenario.init("Some form", html(
    head(
        title("Some form"),
        model(
            mainInstance(t("data id=\"some-form\"",
                t("choice"),
                t("select")
            )),
            instance("instance",
                item("a", "A"),
                item("b", "B")
            ),
            bind("/data/choice").type("string"),
            bind("/data/select").type("string")
        )
    ),
    body(
        input("/data/choice"),
        select1Dynamic("/data/select", "instance('instance')/root/item[value = /data/choice]")
    )
));

int evaluations = Measure.withMeasure(asList("PredicateEvaluation", "IndexEvaluation"), () -> {
    scenario.answer("/data/choice", "a");
    scenario.choicesOf("/data/select");

    scenario.answer("/data/choice", "b");
    scenario.choicesOf("/data/select");
});

// Check that we do less than (size of secondary instance) * (number of choice lookups)
assertThat(evaluations, lessThan(4));
@seadowg seadowg added this to the v2023.2 milestone Jul 26, 2023
@github-project-automation github-project-automation bot moved this to not ready in ODK Collect Jul 26, 2023
@seadowg seadowg moved this from not ready to backlog in ODK Collect Jul 26, 2023
@seadowg seadowg self-assigned this Jul 26, 2023
@seadowg seadowg moved this from backlog to in progress in ODK Collect Jul 26, 2023
@seadowg seadowg modified the milestones: v2023.2, v2023.3 Jul 26, 2023
@github-project-automation github-project-automation bot moved this from in progress to done in ODK Collect Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: done
Development

Successfully merging a pull request may close this issue.

1 participant