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

Bump unrolled/render to v1.1.0 #15581

Merged
merged 1 commit into from
Apr 22, 2021
Merged

Bump unrolled/render to v1.1.0 #15581

merged 1 commit into from
Apr 22, 2021

Conversation

nsmith5
Copy link
Contributor

@nsmith5 nsmith5 commented Apr 22, 2021

unrolled/render is used to render content. For HTML templates, it uses a buffer pool. A buffer must be used when HTML templating to check for templating errors before writing content to the response writer (because the first write will implicitly set the status to 200 if not already set).

In versions <= v1.0.3 the buffer pool used was set to 64 buffers that could grow indefinitely. In practice this would lead to 64 * the largest template size in memory usage. In v1.1.0, the buffer pool is configurable, but defaults to a more reasonable 32 * 512KiB buffers. Instead of growing indefinitely, buffers are garbage collected if they grow pasted the 512KiB limit. This means the buffer pool has a fixed cost of 16MiB.

Further details and profiling results can be seen in the pull request upstream : unrolled/render#87

v1.1.0 has improved buffer pooling
@lunny lunny added the performance/memory Performance issues affecting memory use label Apr 22, 2021
@lunny lunny added this to the 1.15.0 milestone Apr 22, 2021
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Apr 22, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 22, 2021
@zeripath zeripath merged commit 445e47b into go-gitea:master Apr 22, 2021
@6543
Copy link
Member

6543 commented Apr 22, 2021

@nsmith5 can you send a backport to v1.14. If you need help just ask :)

@nsmith5
Copy link
Contributor Author

nsmith5 commented Apr 22, 2021

@6543 yeah absolutely. Is there a release branch or something I need to target for v.1.14?

@6543
Copy link
Member

6543 commented Apr 22, 2021

@nsmith5 yes -> just cherry-pick the squashed commit and create a pull targeting release/v1.14

@zeripath
Copy link
Contributor

@nsmith5 the below is my script for creating backports quickly.

#!/bin/sh
PR="$1"
SHA="$2"
VERSION="$3"

if [ -z "$SHA" ]; then
    SHA=$(gh api /repos/go-gitea/gitea/pulls/$PR -q '.merge_commit_sha')
fi

if [ -z "$VERSION" ]; then
    VERSION="v1.14"
fi

echo git checkout origin/release/"$VERSION" -b backport-$PR-$VERSION
git checkout origin/release/"$VERSION" -b backport-$PR-$VERSION
git cherry-pick $SHA && git commit --amend && git push zeripath backport-$PR-$VERSION && xdg-open https://github.com/go-gitea/gitea/compare/release/"$VERSION"...zeripath:backport-$PR-$VERSION

@nsmith5
Copy link
Contributor Author

nsmith5 commented Apr 24, 2021

Backported here #15608

@nsmith5 nsmith5 deleted the nsmith/bump-unrolled-render branch April 24, 2021 16:10
@techknowlogick techknowlogick added the backport/done All backports for this PR have been created label Apr 24, 2021
lunny pushed a commit that referenced this pull request Apr 25, 2021
v1.1.0 has improved buffer pooling
@go-gitea go-gitea locked and limited conversation to collaborators Jun 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. performance/memory Performance issues affecting memory use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants