GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: dynamically register jni methods and use @FastNative & @CriticalNative by triniwiz · Pull Request #1792 · NativeScript/android

Conversation

@triniwiz

@triniwiz triniwiz commented Nov 8, 2023

Copy link
Copy Markdown
Member

More info on @FastNative & @CriticalNative can be found here https://developer.android.com/training/articles/perf-jni#faster-native-calls-with-fastnative-and-criticalnative

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vallemar reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@triniwiz
feat: use @fastNative & @CriticalNative
04216ae
Using the new annotations to improve the runtime for our jni calls
@cla-bot cla-bot Bot added the cla: yes label Nov 8, 2023
edusperoni
edusperoni reviewed Nov 8, 2023
View reviewed changes
Comment thread test-app/runtime/src/main/java/com/tns/Runtime.java
Comment on lines +47 to 57
@FastNative
private native void runModule(int runtimeId, String filePath) throws NativeScriptException;

@FastNative
private native void runWorker(int runtimeId, String filePath) throws NativeScriptException;

@FastNative
private native Object runScript(int runtimeId, String filePath) throws NativeScriptException;

@FastNative
private native Object callJSMethodNative(int runtimeId, int javaObjectID, String methodName, int retType, boolean isConstructor, Object... packagedArgs) throws NativeScriptException;

@edusperoni edusperoni Nov 8, 2023

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

not sure if these should be FastNative. FastNative completely disables GC while it's running, and these could likely run for a good while.

callJSMethodNative is even trickier because we can go java->native->java->native multiple times in long running methods

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

triniwiz reacted with eyes emoji
All reactions
  • 👀 1 reaction

@triniwiz triniwiz Nov 8, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

So the fastest we can go for those would be !

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@edusperoni edusperoni edusperoni left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@triniwiz @edusperoni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.