Skip to content

Conversation

@HerrCai0907
Copy link
Member

In the implementation of __visit, we will do non-zero check, so in visitMemberOf, we don't need to emit non-zero check.
Emit them both maybe have some performance benefit (I don't do bench for it), but at least for -Oz target, we should remove it.

exportfunction__visit(ptr: usize,cookie: i32): void{if(!ptr)return; ...

@HerrCai0907HerrCai0907force-pushed the avoid-meaningless-check-before-visit branch from 51537b4 to 0adf149CompareJuly 10, 2025 10:43
Copy link
Member

@CountBleckCountBleck left a comment

Choose a reason for hiding this comment

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

Looks great! How'd you notice this?

@HerrCai0907
Copy link
MemberAuthor

HerrCai0907 commented Jul 11, 2025

I am improving the runtime performance and reviewing generated code line by line. 😅

@HerrCai0907HerrCai0907 merged commit ef01f2b into AssemblyScript:mainJul 11, 2025
14 checks passed
@HerrCai0907HerrCai0907 deleted the avoid-meaningless-check-before-visit branch July 11, 2025 02:10
Sign up for freeto 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

@HerrCai0907@CountBleck