Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Tweak cost of running concat#1269

Merged
imalsogreg merged 4 commits intomasterfrom
greg/gas-concat
Aug 7, 2023
Merged

Tweak cost of running concat#1269
imalsogreg merged 4 commits intomasterfrom
greg/gas-concat

Conversation

@imalsogreg
Copy link
Copy Markdown
Contributor

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:

  • Test coverage for the proposed changes
  • PR description contains example output from repl interaction or a snippet from unit test output
  • N/A Documentation has been updated if new natives or FV properties have been added. To generate new documentation, issue cabal run tests. If they pass locally, docs are generated.
  • Any changes that could be relevant to users have been recorded in the changelog
  • N/A In case of changes to the Pact trace output (pact -t), make sure pact-lsp is in sync.

Additionally, please justify why you should or should not do the following:

  • Confirm replay/back compat
  • Benchmark regressions
  • (For Kadena engineers) Run integration-tests against a Chainweb built with this version of Pact

@kadena-io kadena-io deleted a comment from rsoeldner Aug 7, 2023
in
GTextConcatenation nChars nStrings
computeGas' i concatGasCost $ let
ls' = V.toList ls
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

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

@imalsogreg imalsogreg merged commit 9a0b555 into master Aug 7, 2023
@imalsogreg imalsogreg deleted the greg/gas-concat branch August 7, 2023 20:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants