Closed paneq closed 10 years ago
It can be related to this part of code:
#--
# By NOT dup'ing the join_point, we save about 25% on the overhead! However, we
# compromise thread safety, primarily because the join_point's context object will be changed.
# TODO Refactor context out of static join point part.
# Note that we have to assign the parameters and block to the context object in case
# the advice calls "proceed" or "invoke_original_join_point" without arguments.
#++
It seems to be an optimization, that may be less important in places where we care about Thread safety.
Thanks for pointing that out. I'll take a look this weekend. dean
On Fri, Jul 19, 2013 at 6:40 AM, Andrzej Krzywda notifications@github.comwrote:
It can be related to this part of code:
--
By NOT dup'ing the join_point, we save about 25% on the overhead! However, we
compromise thread safety, primarily because the join_point's context object will be changed.
TODO Refactor context out of static join point part.
Note that we have to assign the parameters and block to the context object in case
the advice calls "proceed" or "invoke_original_join_point" without arguments.
++
It seems to be an optimization, that may be less important in places where we care about Thread safety.
— Reply to this email directly or view it on GitHubhttps://github.com/deanwampler/Aquarium/issues/39#issuecomment-21243017 .
Dean Wampler, Ph.D. "Functional Programming for Java Developers", "Programming Scala", and "Programming Hive" - all from O'Reilly twitter: @deanwampler, @chicagoscala http://polyglotprogramming.com
@deanwampler Any news here? We already use aquarium in places where thread-safety doesn't matter, but it would be great to use it also in thread-sensitive environments.
Is there any way we can help you here?
Hi, Andrzej,
Thanks for bugging me about this. I haven't had any time recently to work on this, between client commitments and too many conferences recently. However, I took the time today and have it working.
It was actually a simple one-line change to Aspect::alias_original_method_text. It now makes a copy of the joinpoint rather than sharing a mutable one. I needed time to test this and verify that the performance was acceptable. When I wrote Aquarium circa 2006, the overhead for copies was 30%! It's now considerably smaller, no doubt due to improvements in both cruby and hardware.
I have pushed these changes to GitHub. It will be version 0.6.0, which I'll release as soon as I can. I need to get the jruby tests passing first and also update the packaging and publishing rake tasks (Unfortunately, since I don't work very often with Ruby these days, when I need to revisit Aquarium, I often need to update rake and other stuff, including the packaging and publishing tools, etc.)
So, I may not have time tomorrow or the next several days (travel), but worst case, I'll get that done by next weekend.
Yours, Dean
On Fri, Sep 27, 2013 at 8:22 AM, Andrzej Krzywda notifications@github.comwrote:
@deanwampler https://github.com/deanwampler Any news here? We already use aquarium in places where thread-safety doesn't matter, but it would be great to use it also in thread-sensitive environments.
Is there any way we can help you here?
—
Reply to this email directly or view it on GitHubhttps://github.com/deanwampler/Aquarium/issues/39#issuecomment-25244458 .
Dean Wampler, Ph.D. "Functional Programming for Java Developers", "Programming Scala", and "Programming Hive" - all from O'Reilly twitter: @deanwampler, @chicagoscala http://polyglotprogramming.com
Ij
I released v0.6.0 with this fix.
Compare it to unaspected version: