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

Template rendering performance issue has been fixed #60

Merged
merged 8 commits into from
Jan 31, 2022

Conversation

tarampampam
Copy link
Owner

@tarampampam tarampampam commented Jan 30, 2022

Description

Fixed

  • Performance issue, that affects template rendering. Now templates are cached in memory (for 2 seconds), and it has improved performance by more than 200%

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I wrote unit tests for my code (if tests is required for my changes)
  • I have made changes in CHANGELOG.md file

@tarampampam tarampampam self-assigned this Jan 30, 2022
@codecov
Copy link

codecov bot commented Jan 30, 2022

Codecov Report

Merging #60 (44d2213) into master (690a405) will increase coverage by 4.11%.
The diff coverage is 72.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   38.76%   42.88%   +4.11%     
==========================================
  Files          31       32       +1     
  Lines        1024     1138     +114     
==========================================
+ Hits          397      488      +91     
- Misses        596      617      +21     
- Partials       31       33       +2     
Impacted Files Coverage Δ
internal/cli/build/command.go 0.00% <0.00%> (ø)
internal/http/core/errorpage.go 0.00% <0.00%> (ø)
internal/http/handlers/errorpage/handler.go 0.00% <0.00%> (ø)
internal/http/handlers/index/handler.go 0.00% <0.00%> (ø)
internal/http/server.go 0.00% <0.00%> (ø)
internal/tpl/render.go 74.80% <83.83%> (+24.80%) ⬆️
internal/tpl/hasher.go 100.00% <100.00%> (ø)
internal/tpl/properties.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 690a405...44d2213. Read the comment docs.

@tarampampam
Copy link
Owner Author

Сache size must be limited, otherwise, there will be memory leaks (e.g. with unique RequestID in props)

@tarampampam
Copy link
Owner Author

Cache items now have a TTL

@tarampampam tarampampam marked this pull request as ready for review January 31, 2022 08:43
@tarampampam tarampampam merged commit cc6cbc7 into master Jan 31, 2022
@tarampampam tarampampam deleted the fix-rendering-perf branch January 31, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant