perf: use push_str instead of format! in shader preprocessor #715

Open
SakulFlee wants to merge 1 commit from perf/shader-preprocessor-push-str into main
Owner

The shader preprocessor was using format!("{output}\n{line}") to build
the output string, which creates a new allocation on every line. This
is O(n²) for shaders with many lines. Now uses push_str with a newline
separator for O(n) string building.

The shader preprocessor was using format!("{output}\n{line}") to build the output string, which creates a new allocation on every line. This is O(n²) for shaders with many lines. Now uses push_str with a newline separator for O(n) string building.
perf: use push_str instead of format! in shader preprocessor
All checks were successful
ci/woodpecker/push/linting Pipeline was successful
d9089ba411
The shader preprocessor was using format!("{output}\n{line}") to build
the output string, which creates a new allocation on every line. This
is O(n²) for shaders with many lines. Now uses push_str with a newline
separator for O(n) string building.
Some checks are pending
ci/woodpecker/push/linting Pipeline was successful
ci/woodpecker/pr/test
Required
ci/woodpecker/pr/linting
Required
Some required checks are missing.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin perf/shader-preprocessor-push-str:perf/shader-preprocessor-push-str
git switch perf/shader-preprocessor-push-str
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
SakulFlee/Orbital!715
No description provided.