Skip to content

Optimize string copying in rebuffer() and stgwrite() #269

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

Merged
merged 1 commit into from
Apr 22, 2018

Conversation

Daniel-Cortez
Copy link
Contributor

In this patch I've replaced loops with CHECK_STGPIPE/CHECK_STGBUFFER checks at every iteration with a single buffer growth check and a memcpy call.
This doesn't do much performance-wise, but I think it's still good to have.

Also it seems that the same kind of optimisation has already been applied in stgwrite within the else branch, but for some reason not within the if (staging) branch.

@maddinat0r
Copy link
Contributor

Also it seems that the same kind of optimisation has already been applied in stgwrite within the else branch, but for some reason not within the if (staging) branch.

That was actually my doing! The unoptimized code in the else branch was overall a pretty big bottleneck back then, that's why I optimized only that part.

@Zeex Zeex merged commit e94c0fc into pawn-lang:master Apr 22, 2018
@Daniel-Cortez Daniel-Cortez deleted the sc7-opt branch August 5, 2018 21:50
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.

3 participants