Skip to content

Conversation

@apocelipes
Copy link
Contributor

//go:noescape,nosplit is not correct directives.

The correct one is

//go:nosplit
//go:noescape
func _count(...)

The origin code leaks the paramter to heap:
image

This PR fixes it and can gain 10% speedup for QueryKey.

Speedup:
image

image

`//go:noescape,nosplit` is not correct directives.

The correct one is `//go:nosplit\n//go:noescape`.
@apocelipes
Copy link
Contributor Author

@kelindar Please take a look.

Copy link
Owner

@kelindar kelindar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@kelindar kelindar merged commit f172a65 into kelindar:main May 19, 2025
2 checks passed
@apocelipes apocelipes deleted the fix-noescape branch May 20, 2025 01:48
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