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

Use Growable Vectors in MCMC in BAS to reduce memory #91

Open
merliseclyde opened this issue Jan 16, 2025 · 0 comments
Open

Use Growable Vectors in MCMC in BAS to reduce memory #91

merliseclyde opened this issue Jan 16, 2025 · 0 comments
Assignees
Labels
CRAN Note Notes on cran-checks to address enhancement work in progress

Comments

@merliseclyde
Copy link
Owner

merliseclyde commented Jan 16, 2025

As a way to eliminate allocation of more memory than needed, use growable vectors to reduce memory footprint growing as needed.

See the function EnlargeVector as a prototype to use initially and possibly improve for memory management (use memcpy and memset instead of a loop for certain classes where feasible). A version without SEXP types that uses R_Realloc could be more efficient in terms of memory, but need to check on how the expanded space is initialized, per certain CRAN checks.

This should eliminate the use of SETLENGTH (see issue #82) via xlengthgets.

@merliseclyde merliseclyde added enhancement CRAN Note Notes on cran-checks to address labels Jan 16, 2025
@merliseclyde merliseclyde self-assigned this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CRAN Note Notes on cran-checks to address enhancement work in progress
Projects
None yet
Development

No branches or pull requests

1 participant