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

Update replace-placeholder.sh #380

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dvusboy
Copy link

@dvusboy dvusboy commented Sep 21, 2024

Speed up the replacement loop

  • only look at files with the "$FROM" pattern

Speed up the replacement loop

* only look at files with "$FROM" pattern
@dvusboy
Copy link
Author

dvusboy commented Sep 21, 2024

A quick test with v4.5.3 shows these results:

Current:

root@4f3f81c57237:/calcom/apps# FROM='http://localhost:3000'; TO='https://cal.example.com'; time find web/.next/ web/public/ -type f | while read file; do sed -i "s|$FROM|$TO|g" "$file"; done

real	1m22.762s
user	0m52.981s
sys	0m44.544s

New:

root@a6f1f3600029:/calcom/apps# FROM='http://localhost:3000'; TO='https://cal.example.com'; time for file in $(egrep -r -l "$FROM" web/.next/ web/public/); do sed -i -e "s|$FROM|$TO|g" "$file"; done

real	0m3.356s
user	0m1.487s
sys	0m1.958s

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.

1 participant