

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
31 messages in org.codehaus.groovy.devRe: [groovy-dev] as usual on performa...| From | Sent On | Attachments |
|---|---|---|
| Alex Tkachman | Feb 27, 2008 5:38 am | |
| Guillaume Laforge | Feb 27, 2008 5:47 am | |
| Alex Tkachman | Feb 27, 2008 6:01 am | |
| Chanwit Kaewkasi | Feb 27, 2008 6:21 am | |
| Martin C. Martin | Feb 27, 2008 6:27 am | |
| Jochen Theodorou | Feb 27, 2008 6:32 am | |
| Jochen Theodorou | Feb 27, 2008 6:33 am | |
| tugwilson | Feb 27, 2008 6:55 am | |
| Chanwit Kaewkasi | Feb 27, 2008 7:15 am | |
| Chanwit Kaewkasi | Feb 27, 2008 8:01 am | |
| Jochen Theodorou | Feb 27, 2008 8:28 am | |
| tugwilson | Feb 27, 2008 9:00 am | |
| tugwilson | Feb 27, 2008 9:55 am | |
| Chanwit Kaewkasi | Feb 27, 2008 11:27 am | |
| Chanwit Kaewkasi | Feb 27, 2008 11:31 am | |
| Jochen Theodorou | Feb 27, 2008 11:36 am | |
| Alex Tkachman | Feb 27, 2008 11:58 am | |
| Martin C. Martin | Feb 27, 2008 12:18 pm | |
| Jochen Theodorou | Feb 27, 2008 12:37 pm | |
| Jochen Theodorou | Feb 27, 2008 12:45 pm | |
| tugwilson | Feb 27, 2008 12:48 pm | |
| tugwilson | Feb 27, 2008 12:51 pm | |
| Martin C. Martin | Feb 27, 2008 1:27 pm | |
| Alex Tkachman | Feb 27, 2008 1:48 pm | |
| tugwilson | Feb 27, 2008 2:14 pm | |
| Jochen Theodorou | Feb 27, 2008 5:09 pm | |
| Alexandru Popescu ☀ | Feb 27, 2008 5:38 pm | |
| Charles Oliver Nutter | Feb 28, 2008 12:20 am | |
| Jochen Theodorou | Feb 28, 2008 1:33 am | |
| Alexandru Popescu ☀ | Feb 28, 2008 2:56 am | |
| tugwilson | Feb 28, 2008 3:29 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [groovy-dev] as usual on performance - operations on primitives | Actions... |
|---|---|---|
| From: | tugwilson (tu...@wilson.co.uk) | |
| Date: | Feb 28, 2008 3:29:01 am | |
| List: | org.codehaus.groovy.dev | |
Alexandru Popescu ☀ wrote:
On Thu, Feb 28, 2008 at 11:33 AM, Jochen Theodorou <blac...@gmx.org> wrote:
Alexandru Popescu ☀ schrieb: [...]
If a MetaClass is changed in another thread, when exactly needs the current thread respect this?
[...]
I think the change should follow (if possible) the Java Memory Model, and so affect concurrent threads if there are any happens-before elements available.
well, ok, but how does this answer the question? John, how does Ng behave here?
Well, I guess it answers your question :-), and here it is how: if one of the variables involved is declared as volatile then the change in metaclass should kick in right away. If there is no volatile involved (or synchronized field access) then the metaclass change may not be considered during the loop.
The issue is not the volatility of the variable it's the volatility of the behaviour of the value of the variable. Declaring a variable volatile is irrelevant.
However the behaviour of the object may be changed as a result of performing an operation on the object (because the MetaClass can change its behaviour as a result of an operation being performed via the MetaClass). That is to say that you don't just have to worry about another thread monkey patching the behaviour of Integer you have to worry about your own thread monkey patching the behaviour of Integer. So every time you make a method call you have to check to see if the behaviour is changed. However as everything goes via the MetaClass you are making a method call per operation so you *can't* assume that the behaviour of Integer is unchanged for the duration of an expression.
We're trying to run before we can walk.
There's a huge performance gain available by doing straightforward optimisation of the execution paths through the run time system. It's not productive to expend effort on questionable "optimisation" special cases when the general case can be vastly improved. You need to solve the general problem satisfactorily before addressing the special cases.
John Wilson
--
View this message in context:
http://www.nabble.com/as-usual-on-performance---operations-on-primitives-tp15713441p15734481.html
Sent from the groovy - dev mailing list archive at Nabble.com.
--------------------------------------------------------------------- To unsubscribe from this list, please visit:







