-
Notifications
You must be signed in to change notification settings - Fork 719
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
[PERF] - Performance issues with functions using toLedgerPParams
in cardano-api
#4622
Comments
toLedgerPParams
in cardano-apitoLedgerPParams
in cardano-api
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days. |
We noticed this as well. I put together a patch against |
Wouldn't it be sufficient to change the signature from:
to: or if we don't want to change it, provide a new function with the second signature? |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days. |
Internal/External
Internal
Area
Other
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.Steps to reproduce
Steps to reproduce the behavior:
toLedgerPParams
such asmakeTransactionBody
andevaluateTransactionFee
.Expected behavior
I'm expecting that the conversion between cardano-api's ProtocolParameter and cardano-ledger's PParams does not require significant computation.
Even better, I think we should probably not have a different datatype for protocol parameters as we already have one in cardano-ledger. Why not create a wrapper on top of it instead of defining a different data type?
System info (please complete the following information):
Screenshots and attachments
Here are some profiling results of the problematic functions:
Additional context
None
The text was updated successfully, but these errors were encountered: