VisionSystemsInc / VisionSystemsInc/vsi_common

OPTIMIZE: replace read with printf

Open
#181 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
Shell
Stars
8
Forks
9
Avg merge
36m
Merged PRs (30d)
1

Description

printf -v var_name '%s' "${value}" # %s is important here to prevent escaping

appears to be 400% faster than

read -r -d '' var_name <<< "${value}"

If there are no side effects, everything that can and uses read and can be replaced with printf

  • Verify speed on mac
  • Verify speed on windows
  • Verify speed on linux

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by locating uses of read in the repository and compare each use with the shown printf -v form, checking for side effects and platform behavior. Done means applicable uses are replaced without changing behavior and the relevant checks still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.