-
Notifications
You must be signed in to change notification settings - Fork 483
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
Performance issues with applyCostModelParams
#4962
Comments
I'm unsure if this can be solved, but maybe Kenneth can take a look. |
There's an issue for this at PLT-1243, and it seems that @effectfully has some ideas. We should try to find some time to work on it. |
There was some more discussion here. I think the conclusion was that we shouldn't worry. I'd be fine if this issue was simply closed. |
As Kenneth pointed out, ticket created already. We can close this when we finish it (PLT-1243). |
Checking the various discussions mentioned, it seems that the solution is that callers should call So do we think it's safe to close this? Any comments from @koslambrou / @michaelpj / @zliu41 ? |
I have one idea that I'm pretty sure is going to help with at least a part of the issue (maybe not a bottleneck, though) and one hunch that I never had the time/need to investigate. The idea is to stop doing quadratic things when superlinear will suffice (documented somewhere in Jira) and a hunch is that we can structure |
Agreed. |
@kwxm I'm good with closing it. Explicit caching is the way to go :) |
Oh, GitHub seems to have automatically closed this when I merged the branch. I didn't know it could do that. It seems that it's because of the "Closes #4962" comment. |
Summary
We noticed some significant performance issues with
Cardano.Api.Fees.evaluateTransactionFee
andCardano.Api.TxBody.makeTransactionBody
. After profiling the code, we noticed that the reason was because the functions would convertCardano.Api.ProtocolParameters
to cardano-ledger'sPParams
every time we call one of the functions. However, the conversion between the two datatypes take s a significant amount of time because of a plutus-core function (applyCostModelParams ) when creating the cost model.An issue was created on
cardano-node
repo IntersectMBO/cardano-node#4622 in order to bypass the conversion.Steps to reproduce the behavior
Run profiling on a code which uses any function from cardano-api which uses
toLedgerPParams
such asmakeTransactionBody
andevaluateTransactionFee
.Actual Result
Slow
Expected Result
Faster
Describe the approach you would take to fix this
No idea.
System info
OS: NixOS
Version: master
commit hash: a56c965
The text was updated successfully, but these errors were encountered: