Skip to content

builtin,v: reduce overhead and memory usage for very frequently called methods - #21540

Merged
spytheman merged 7 commits into
vlang:masterfrom
spytheman:v_compiler_optimisations
May 21, 2024
Merged

spytheman merged 7 commits into
vlang:masterfrom
spytheman:v_compiler_optimisations

Conversation

@spytheman

Copy link
Copy Markdown
Contributor
  • checker: minimise the amount of string interpolation inside selector_expr
  • builtin: remove string.clone() calls, in the most common case of interpolating strings (with no uppercasing or padding)
  • v.ast: use != 0 instead of > 0, for commonly used methods like Type.has_flag() etc
  • v.ast: eliminate array_get calls from Table.final_sym and Table.sym (make profiling data more useful)
  • cgen: reduce interpolations in Gen.string_inter_literal
  • cgen: small optimisation of frequently called cescape_nonascii
  • v.util: check more strictly for a valid input in util.tabs/1

@spytheman spytheman changed the title v compiler optimisations builtin,v: reduce overhead and memory usage for very frequently called methods May 20, 2024
@spytheman

Copy link
Copy Markdown
Contributor Author

The RAM usage of the compiler is improved a bit, as well as the performance of mainly the checker:
image

image

@spytheman
spytheman merged commit 84fbe27 into vlang:master May 21, 2024
@felipensp

Copy link
Copy Markdown
Member

Excellent work. πŸ₯‡

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.

2 participants