Skip to content
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

Use string builder to avoid copies on notes rendering #978

Merged
merged 1 commit into from
Dec 21, 2019
Merged

Use string builder to avoid copies on notes rendering #978

merged 1 commit into from
Dec 21, 2019

Conversation

saschagrunert
Copy link
Member

We now use the strings.Builder to avoid a lot of copies
during document rendering.

Beside this, we render the markdown in a temporarily buffer before
writing it into a file. This will be needed when it comes to the TOC
generation which will be an intermediate step.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 16, 2019
@k8s-ci-robot k8s-ci-robot added area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 16, 2019
@saschagrunert
Copy link
Member Author

@hoegaarden, @cpanato @justaugustus may I ask for a review? :)

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm very nice!
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 18, 2019
@justaugustus
Copy link
Member

Need rebase

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 19, 2019
We now use the `strings.Builder` to avoid a lot of copies
during document rendering.

Beside this, we render the markdown in a temporarily buffer before
writing it into a file. This will be needed when it comes to the TOC
generation which will be an intermediate step.

Signed-off-by: Sascha Grunert <[email protected]>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 19, 2019
@saschagrunert
Copy link
Member Author

Need rebase

Rebased on top of the latest master.

Copy link
Contributor

@hoegaarden hoegaarden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please catch the errors when you write to the string builder.

@saschagrunert
Copy link
Member Author

saschagrunert commented Dec 19, 2019

Please catch the errors when you write to the string builder.

The string builder always returns nil as error:
https://golang.org/src/strings/builder.go

@hoegaarden
Copy link
Contributor

TIL:

The string builder always returns nil as error:

👍

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 20, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, hoegaarden, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@justaugustus
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 21, 2019
@k8s-ci-robot k8s-ci-robot merged commit bdf9ef2 into kubernetes:master Dec 21, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Dec 21, 2019
@saschagrunert saschagrunert deleted the string-builder branch December 21, 2019 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/release Categorizes an issue or PR as relevant to SIG Release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants