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

replace List with [] in static series, then covert at end return (it’s faster) #1259

Open
Tracked by #1014
DaveSkender opened this issue Oct 10, 2024 · 0 comments
Open
Tracked by #1014
Milestone

Comments

@DaveSkender
Copy link
Owner

DaveSkender commented Oct 10, 2024

See EMA in v3 for example. Keep in mind, this approach is only faster in certain circumstances, so performance test comparison is required to see where it's better. For example, the simple ADL indicator remains faster with List<AdlResult> composition.

To avoid copying the underlying array, remember to use:

return new List<TrResult>(results);

Instead of:

return results.ToList();

References and examples:

EmaResult[] results = new EmaResult[length];

@DaveSkender DaveSkender converted this from a draft issue Oct 10, 2024
@DaveSkender DaveSkender added this to the v3 milestone Oct 10, 2024
@DaveSkender DaveSkender moved this from Maybe to Do Next in Stock Indicators for .NET Oct 10, 2024
@DaveSkender DaveSkender linked a pull request Oct 10, 2024 that will close this issue
29 tasks
@DaveSkender DaveSkender modified the milestones: v3, v3.1 Oct 10, 2024
@DaveSkender DaveSkender removed a link to a pull request Oct 10, 2024
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant