fix: speed up installer script in interactive mode by using builtin curl progress functionality#23008
Open
karlicoss wants to merge 1 commit intoanomalyco:devfrom
Open
fix: speed up installer script in interactive mode by using builtin curl progress functionality#23008karlicoss wants to merge 1 commit intoanomalyco:devfrom
karlicoss wants to merge 1 commit intoanomalyco:devfrom
Conversation
…url progress functionality Fixes anomalyco#22998 Before the changes the installation was taking ~50 seconds for me. The actual opencode binary is just 50MB, and manual curl download from github is instantaneous. The reason is `--trace-ascii` flag is producing _a lot_ of stderr output which is later parsed with sed to recover the progress. This is also eating a lot of CPU in process. Running this `bash install.sh --no-modify-path 2>/dev/null` confirms it -- completes in a second since it's not doing `--trace-ascii` anymore. Switching to builtin curl `--progress-bar` resolves the issue. Testing: tested on Ubuntu 24.04 - `bash install.sh 2>/dev/null` -- works as before; no progress - `bash install.sh`: works and results in the following output ``` Installing opencode version: 1.4.7 ######################################################################################################### 100.0% ▄ █▀▀█ █▀▀█ █▀▀█ █▀▀▄ █▀▀▀ █▀▀█ █▀▀█ █▀▀█ █░░█ █░░█ █▀▀▀ █░░█ █░░░ █░░█ █░░█ █▀▀▀ ▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ OpenCode includes free models, to start: cd <project> # Open directory opencode # Run command For more information visit https://opencode.ai/docs ``` Not as fancy, but it hardly matters when setup takes 1 second!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #22998
Type of change
What does this PR do?
Before the changes the installation was taking ~50 seconds for me.
The actual opencode binary is just 50MB, and manual curl download from github is instantaneous.
This is pretty annoying for ad-hoc setups, e.g. using opencode inside devcontaniers etc.
The reason is
--trace-asciiflag is producing a lot of stderr output which is later parsed withsedto recover the progress. This is also eating a lot of CPU in process.Running this
bash install.sh --no-modify-path 2>/dev/nullconfirms it -- completes in a second since it's not doing--trace-asciianymore.Switching to builtin curl
--progress-barresolves the issue. Doesn't look as fancy, but it hardly matters when setup takes 1 second!How did you verify your code works?
Tested on Ubuntu 24.04
bash install.sh 2>/dev/null-- works as before; no progressbash install.sh: works and results in the output belowScreenshots / recordings
Difficult to record since it's so fast now 😅 This is how it looks:
Checklist