-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Add short circuit for public method to avoid unnecessary synchronization and cache #90
Comments
It at least misses two things: checkPermission and invokeMethodInSandbox. |
Please think twice, is it necessary for real public methods? if yes, we could call it before real method invoke, my point is avoiding synchronization and reduce cache size. |
Yes I see; I meant your proposal deletes two functionalities from current logic for public methods: 1. checkPermision: checks if user has blocked this method execution. 2. invokeMethodInSandbox: runs user method inside internal sandbox.
Anyway, do you have any problem with its performance currently?
…________________________________________
From: Yanming Zhou <[email protected]>
Sent: Tuesday, October 29, 2019 3:49 AM
To: jkuhnert/ognl
Cc: Yasser Zamani; Mention
Subject: Re: [jkuhnert/ognl] Add short circuit for public method to avoid unnecessary synchronization and cache (#90)
Please think twice, is it necessary for real public methods? if yes, we could call it before real method invoke, my point is avoiding synchronization and reduce cache size.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#90>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABL5HNV2SV7C55NVCMMNIMTQQ56P3ANCNFSM4JFW2PNA>.
|
I've tested one simple scene of my actual application, throughput could increase about 5%, I think it worth a shot. |
Hello. The proposed change might improve performance (avoiding some synchronization) for public method calls but there may not be a clean way to preserve the permission checks and sandboxing calls in the new code path (without reintroducing some form of synchronization). Some kind of opt-in mechanism to bypass the checks/synchronization for public methods might be possible ... but the risk of bypassing the checks probably outweighs a small performance gain. |
Here is my proposal:
add
before
https://github.com/jkuhnert/ognl/blob/32d076d209c11da12bebe48d88321b961ac1b087/src/java/ognl/OgnlRuntime.java#L1132
@yasserzamani @lukaszlenart WDYT?
The text was updated successfully, but these errors were encountered: