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

cgen: reduce RAM usage, by avoiding a .str() call, for the final string builder, containing the final C program, used to write it to a file #23226

Conversation

spytheman
Copy link
Member

@spytheman spytheman commented Dec 20, 2024

#0 22:33:59 ^ cgen_avoid_making_a_string_from_the_final_builder /v/oo>xtime ./vold -o x.c cmd/v
CPU: 2.56s      Real: 2.52s     Elapsed: 0:02.52        RAM: 428828KB   ./vold -o x.c cmd/v
#0 22:38:55 ^ cgen_avoid_making_a_string_from_the_final_builder /v/oo>xtime ./vnew -o x.c cmd/v
CPU: 2.54s      Real: 2.24s     Elapsed: 0:02.24        RAM: 422624KB   ./vnew -o x.c cmd/v
#0 22:39:01 ^ cgen_avoid_making_a_string_from_the_final_builder /v/oo>

The difference for V itself is ~6MB less, due to the avoidance of the final .str() creation.

Huly®: V_0.6-21660

…s the whole program, since it is only going to be used for writing the program to a file
@spytheman spytheman changed the title cgen: avoid a .str() call, for the final string builder, that contains the whole program, since it is only going to be used for writing the program to a file cgen: reduce RAM usage, by avoiding a .str() call, for the final string builder, that contains the whole program, used only for writing the program to a file Dec 20, 2024
@spytheman spytheman changed the title cgen: reduce RAM usage, by avoiding a .str() call, for the final string builder, that contains the whole program, used only for writing the program to a file cgen: reduce RAM usage, by avoiding a .str() call, for the final string builder, containing the final C program, used to write it to a file Dec 20, 2024
@spytheman spytheman merged commit 290f58a into vlang:master Dec 21, 2024
72 checks passed
@spytheman spytheman deleted the cgen_avoid_making_a_string_from_the_final_builder branch December 21, 2024 05:25
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