Skip to content

⚡ Bolt: [Performance] Avoid double matrix inversion in vuongtest#6

Open
seonghobae wants to merge 1 commit into
masterfrom
jules-bolt-perf-optimization-18402877975642012241
Open

⚡ Bolt: [Performance] Avoid double matrix inversion in vuongtest#6
seonghobae wants to merge 1 commit into
masterfrom
jules-bolt-perf-optimization-18402877975642012241

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What: In R/vuongtest.R, cached the original tmpvc matrix inside calcAB() and reused it in calcLambda() instead of using chol2inv(chol(AB1$A)), which mathematically computes the exact same matrix but incurs substantial overhead.
🎯 Why: A <- chol2inv(chol(tmpvc)) computes the inverse of tmpvc. Calling chol2inv(chol(A)) simply re-inverts A back to tmpvc. Double matrix inversion of large positive-definite symmetric matrices represents a redundant O(N^3) operation.
📊 Impact: Speeds up the function notably for models with many parameters by entirely removing a double inversion step. Reduced time in a loop of 100 iterations of simple cfa models from ~8.7s to ~6.2s.
🔬 Measurement: Verified output is mathematically identical and package tests still pass.


PR created automatically by Jules for task 18402877975642012241 started by @seonghobae

💡 What: In R/vuongtest.R, cached the original tmpvc matrix inside calcAB() and reused it in calcLambda() instead of using chol2inv(chol(AB1$A)), which mathematically computes the exact same matrix but incurs substantial overhead.
🎯 Why: A <- chol2inv(chol(tmpvc)) computes the inverse of tmpvc. Calling chol2inv(chol(A)) simply re-inverts A back to tmpvc. Double matrix inversion of large positive-definite symmetric matrices represents a redundant O(N^3) operation.
📊 Impact: Speeds up the function notably for models with many parameters by entirely removing a double inversion step. Reduced time in a loop of 100 iterations of simple cfa models from ~8.7s to ~6.2s.
🔬 Measurement: Verified output is mathematically identical and package tests still pass.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@jules 이거 원본 논문 때문에 이럴 걸?

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