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

Fix cache architecture #82

Merged
merged 5 commits into from
Jun 2, 2024
Merged

Fix cache architecture #82

merged 5 commits into from
Jun 2, 2024

Conversation

s-dwinter
Copy link
Collaborator

Overview

I fix cache architecture.
With this change, the cache will store each value, not the entire values.

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 > /dev/null
./dist/ysr_darwin_arm64/ysr template -c ./example/yashiro.yaml --enable-cache  0.03s user 0.02s system 6% cpu 0.689 total

# cache created
❯ la ./tmp    
.6177735f61702d6e6f727468656173742d315f313635373636303234353135_keyHash
6177735f61702d6e6f727468656173742d315f313635373636303234353135_2f7961736869726f2f6578616d706c65
6177735f61702d6e6f727468656173742d315f313635373636303234353135_2f7961736869726f2f6578616d706c652f736563757265
6177735f61702d6e6f727468656173742d315f313635373636303234353135_key

# secondtime ./dist/ysr_darwin_arm64/ysr template -c ./example/yashiro.yaml --enable-cache --cache-dir ./tmp ./example/example.yaml.tmpl > /dev/null
./dist/ysr_darwin_arm64/ysr template -c ./example/yashiro.yaml --enable-cache  0.02s user 0.01s system 7% cpu 0.325 total

# thirdtime ./dist/ysr_darwin_arm64/ysr template -c ./example/yashiro.yaml --enable-cache --cache-dir ./tmp ./example/example.yaml.tmpl > /dev/null
./dist/ysr_darwin_arm64/ysr template -c ./example/yashiro.yaml --enable-cache  0.02s user 0.01s system 6% cpu 0.354 total

# confirm cache
❯ cat ./tmp/6177735f61702d6e6f727468656173742d315f313635373636303234353135_2f7961736869726f2f6578616d706c65 
{"imageTag": "latest", "roleArn": "arn:aws:iam::012345678901:role/PodRole29A92600-1NSKGEZRCWPNU"}                                           

# encrypted secret value
❯ cat ./tmp/6177735f61702d6e6f727468656173742d315f313635373636303234353135_2f7961736869726f2f6578616d706c652f736563757265 
�����^]�'�r|(_�'&�]� 

@s-dwinter s-dwinter changed the title Feature/fix-cache-arch Fix cache architecture Jun 2, 2024
@s-dwinter s-dwinter added the breaking Indicates a PR that contains breaking changes. label Jun 2, 2024
@s-dwinter s-dwinter marked this pull request as ready for review June 2, 2024 16:45
@s-dwinter s-dwinter force-pushed the feature/fix-cache-arch branch from 934f07a to 73864cd Compare June 2, 2024 17:50
@s-dwinter s-dwinter merged commit dc04cde into main Jun 2, 2024
2 checks passed
@s-dwinter s-dwinter deleted the feature/fix-cache-arch branch June 2, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Indicates a PR that contains breaking changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant