nimble-dev / nimble

The base NIMBLE package for R
http://R-nimble.org
BSD 3-Clause "New" or "Revised" License
156 stars 23 forks source link

improve efficiency of `makeModelDerivsInfo` and `makeOutputNodes` #1435

Closed paciorek closed 4 months ago

paciorek commented 5 months ago

Addresses issue #1431 .

@perrydv would like you to take a look.

perrydv commented 5 months ago

@paciorek I think I can follow the changes and they make sense. I'm fairly confident we could make this even more efficient if we make the code more granular, mainly by pulling out graphIDs directly and retaining them for further steps. Going in and out of the model methods involves flipping between names and IDs multiple times. Also I haven't tested this but I think we could use nodesAlreadyExpanded=TRUE in the call to isStoch. Let me know if you want me to have a try at a more granular implementation.

paciorek commented 5 months ago

Given other priorities, I don't think it's worth the effort. The changes I made were easily sufficient for the large MSOM example that prompted this. We can always revisit.

paciorek commented 4 months ago

Our new-ish Heisenbug is the cause of the test failure.