-
Notifications
You must be signed in to change notification settings - Fork 102
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
Tweak cost of running concat
#1269
Conversation
src/Pact/Native.hs
Outdated
in | ||
GTextConcatenation nChars nStrings | ||
computeGas' i concatGasCost $ let | ||
ls' = V.toList ls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we turning it into a list here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We pass ls'
to T.concat
, and contrary to what you'd expect T.concat
is monomorphic and demands a list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really that's intense. I don't want to armchair microbench but i'd assume vector concat and then a single toList call woudl be better, but I'm not going to stall the PR over it
57348e6
to
15abaf4
Compare
Tweak the gas costing for the
concat
builtin to account for both the number of strings being concatenated, and the length of those strings.PR checklist:
cabal run tests
. If they pass locally, docs are generated.pact -t
), make sure pact-lsp is in sync.Additionally, please justify why you should or should not do the following: