Skip to content

Refactor mess() for efficiency: pre-sort reference columns, vapply, deduplicate block loop - #35

Open
jeffery-leirness wants to merge 4 commits into
rspatial:masterfrom
jeffery-leirness:perf/mess-efficiency
Open

Refactor mess() for efficiency: pre-sort reference columns, vapply, deduplicate block loop#35
jeffery-leirness wants to merge 4 commits into
rspatial:masterfrom
jeffery-leirness:perf/mess-efficiency

Conversation

@jeffery-leirness

Copy link
Copy Markdown

Follow-up to #34 (should be merged first).

Developed with assistance from an AI coding assistant (Posit Assistant / Claude). All changes reviewed, tested, and verified by the PR author.

Changes in R/mess.R:

Extracted .messi_sorted() helper that assumes pre-sorted input, separating the sort step from the per-value computation
Reference columns are now sorted once before the block loop rather than on every iteration inside .messi()
Replaced sapply with vapply in multivariate paths for type-stable, slightly faster output
Deduplicated the full=TRUE/FALSE block loop branches into a single loop with a conditional only on the writeValues call
All existing tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant