Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved function call performance #353

Merged
merged 1 commit into from
Sep 8, 2015

Conversation

Boereck
Copy link

@Boereck Boereck commented Jul 25, 2014

Hi, another change for method call performance. Some unnecessary time was spent in Function#invoke(Class returnType, Object[] inArgs, Map options). The method looked up the method object and the parameter types, although this information is already available, when invoking the method from Library$Handler#invoke(Object proxy, Method method, Object[] inArgs). So I refactored both classes a bit so that no unnecessary work is done. In my tests function calls are now measurably faster and produce fewer objects (->less garbage).

@dblock
Copy link
Member

dblock commented Jul 25, 2014

@Boereck You have to rebase with master. Do this:

# backup any changes, just in case

git checkout master
# rewind your master
git reset HEAD~100

# update from JNA/master
git pull upstream master
git push -f origin master
# now your master is in sync with JNA's

git checkout faster-method-calls
git rebase master
# fix conflicts
git push origin faster-method-calls -f

Then, review the diff here. It should look clean.

Another, possibly simpler way of doing this is to abandon this branch.

git checkout master
# rewind your master
git reset HEAD~100

# update from JNA/master
git pull upstream master
git push -f origin master
# now your master is in sync with JNA's

git checkout -b new-faster-method-calls
git merge faster-method-calls --squash
# the above just picks the changes, check the diff, make sure it's clean, commit, push
git add .
git commit -m "..."
git push origin new-faster-method-calls:faster-method-calls -f

@Boereck
Copy link
Author

Boereck commented Jul 26, 2014

Thanks a lot for your help! I just started my vacation and am away until the 12th of August. I will take care of this as soon as I am back. Currently I am just equipped with my phone.

@Boereck
Copy link
Author

Boereck commented Aug 21, 2014

So the diff here looks good now. You could have a second look now. Thanks!

@twall
Copy link
Contributor

twall commented Oct 10, 2014

Please re-merge from master, which should fix the CI issue, then this can be merged.

@Boereck Boereck force-pushed the faster-method-calls branch 6 times, most recently from 3aa6ea4 to e003913 Compare October 12, 2014 20:45
@Boereck
Copy link
Author

Boereck commented Oct 27, 2014

I moved the commit on top of the latest master now.

@twall
Copy link
Contributor

twall commented Aug 30, 2015

Please resolve the conflict so I can merge this. Sorry for the long delay.

@Boereck Boereck force-pushed the faster-method-calls branch 3 times, most recently from 8338947 to 49359e6 Compare August 31, 2015 21:22
Function#invoke. This saves costs for map and reflection lookups.
twall added a commit that referenced this pull request Sep 8, 2015
Improved function call performance
@twall twall merged commit 89bf40b into java-native-access:master Sep 8, 2015
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.

None yet

3 participants