Skip to content

Replace Napi methods with properties where possible #1010

Open

Description

@CedricGuillemet

Methods like NativeEngine::GetRenderWidth start to appear in CDT profiling. It's called (at least) once per frame even with that few calls, it's slow enough to rise in the top methods.
(

Napi::Value NativeEngine::GetRenderWidth(const Napi::CallbackInfo& info)
)

Replace with properties anywhere possible. Only update the napi value when it changes.

Activity

  1. changed the title [-]Replace Napi method with properties[/-] [+]Replace some Napi methods with properties[/+] on Feb 24, 2022
  2. ryantrem commented on Feb 24, 2022

    @ryantrem
    Member

    We have a number of places where we require function calls into native (either as actual functions or InstanceAccessors) that I think could be worth fixing. This is another example: https://github.dev/BabylonJS/BabylonNative/blob/4fd6df8541c5bc0ae98a9db7879917f46dbc0eb2/Plugins/NativeCamera/Source/NativeVideo.cpp#L19-L24

  3. added this to the 6.0 milestone on Sep 23, 2022
  4. modified the milestones: 6.0, Future on Nov 17, 2022
  5. changed the title [-]Replace some Napi methods with properties[/-] [+]Replace Napi methods with properties where possible[/+] on Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions