Skip to content

Refactor updateUnknownsAndDuplicates to only check certain wells, making it more efficient #591

@fedarko

Description

@fedarko

Recapping this issue: I wrote the following comment in patchWell()

success: function(data) {
that.data[row][that.grid.getColumns()[col].field] = data["sample_id"];
// NOTE: this pretty much checks the status of every well, and this is
// called in patchWell (i.e. every time a well is updated). Should be a
// lot more efficient to minimize the impact of this by just checking for
// changes relative to this well?
that.updateUnknownsAndDuplicates();
var classIdx = that.wellClasses[row][col].indexOf("well-prev-plated");
if (data["previous_plates"].length > 0) {
that.wellPreviousPlates[row][col] = data["previous_plates"];
addIfNotPresent(that.wellClasses[row][col], "well-prev-plated");
} else {
safeArrayDelete(that.wellClasses[row][col], "well-prev-plated");
that.wellPreviousPlates[row][col] = null;
}

@AmandaBirmingham responded to it here

Probably. updateUnknownsAndDuplicates is completely agnostic to whatever change triggered it--but that means it has to be brute-force and re-check everything. I think it is the source of a lot of the performance issues in the platemapper, and probably needs to be rethought from the ground up. Could you add an issue to the repo for this, and then remove this comment?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions