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

Implement cache #81

Merged
merged 1 commit into from
May 27, 2024
Merged

Implement cache #81

merged 1 commit into from
May 27, 2024

Conversation

s-dwinter
Copy link
Collaborator

Overview

Close #74. I implement a cache.

You can contol this feature throgh config file or command line option(default is false).

Valification

I am verifyring thiat running the example with option. I have confirmed that the execution time changes on the second and subsequent runs.

# firsttime ./dist/ysr_darwin_arm64/ysr template -c ./example/yashiro.yaml --enable-cache --cache-dir ./tmp ./example/example.yaml.tmpl
# This is a example of yashiro template.
---
apiVersion: v1
kind: Secret
...

./dist/ysr_darwin_arm64/ysr template -c ./example/yashiro.yaml --enable-cache  0.02s user 0.02s system 6% cpu 0.679 total

# cache file created
❯ la ./tmp                   
.key_hash  key  values

# secondtime ./dist/ysr_darwin_arm64/ysr template -c ./example/yashiro.yaml --enable-cache --cache-dir ./tmp ./example/example.yaml.tmpl
# This is a example of yashiro template.
---
apiVersion: v1
kind: Secret
...

./dist/ysr_darwin_arm64/ysr template -c ./example/yashiro.yaml --enable-cache  0.01s user 0.00s system 73% cpu 0.010 total

@s-dwinter s-dwinter added the feature Categorizes issue or PR as related to a new feature. label May 27, 2024
@@ -51,7 +51,7 @@ func New(cfg *config.Config, option ...Option) (Engine, error) {
}

var encAndDec encoding.EncodeAndDecoder
if opts.TextType == TextTypePlane {
if opts.TextType == TextTypePlain {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fix typo.

@s-dwinter s-dwinter marked this pull request as ready for review May 27, 2024 18:19
@s-dwinter s-dwinter merged commit 2e401b4 into main May 27, 2024
2 checks passed
@s-dwinter s-dwinter deleted the feature/issue-74 branch May 27, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache external store values
1 participant