Skip to content

normalise_distribution: replace arrayfun identity with direct indexing#433

Open
beingamanforever wants to merge 1 commit intognu-octave:mainfrom
beingamanforever:fix/normalise-direct-index
Open

normalise_distribution: replace arrayfun identity with direct indexing#433
beingamanforever wants to merge 1 commit intognu-octave:mainfrom
beingamanforever:fix/normalise-direct-index

Conversation

@beingamanforever
Copy link
Copy Markdown
Contributor

Removed a pointless f_remap = @(k)(normal(k)) closure + arrayfun call, replaced with normal(target_indices) direct indexing.

image

@beingamanforever
Copy link
Copy Markdown
Contributor Author

Basically, arrayfun with an identity closure has massive per-element dispatch overhead vs a single vectorized index operation. The closure adds nothing, it's normal(k) on every element, which is just indexing. All 14 BISTs 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