jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • groovy
  • GROOVY-2503 MOP 2.0 design inflluencing issues
  • GROOVY-1826

Stop requiring exceptions in MetaClass to indicate method/property does not exist

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Sub-task Sub-task
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Currently the MetaClass mechanism has no clean way for a descendent metaclass or runtime code to know if a property or method exists - including those dynamically intercepted/provided by the metaclass.

This means you have to rely on exceptions and this is very costly in performance terms in a multi threaded environment.

See http://jira.codehaus.org/browse/GRAILS-1036

This is a Grails issue with code attached for a workaround for the lack of a hasProperty, hasMethod and hasClosure method on MetaClass. It is ugly but it works, by caching the result of invocations / pickMethod and encoding some special behaviour related to closures. This duplicates/mutates logic currently in MetaClassImpl.invokeMethod() which is a bad thing.

We have seen a 30-50% speed increase in serving Grails pages in concurrent tests after using this new metaclass, instead of catching MissingMethodException and MissingPropertyException.

Also I believe that MetaClass should have invokeClosure on it, and remove some of the closure calling logic from invokeMethod, as this makes for a cleaner separation.

Issue Links

depends upon

Task - A task that needs to be done. GROOVY-2503 MOP 2.0 design inflluencing issues

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
There are no comments yet on this issue.

People

  • Assignee:
    blackdrag blackdrag
    Reporter:
    Marc Palmer
Vote (0)
Watch (1)

Dates

  • Created:
    11/Apr/07 8:45 AM
    Updated:
    30/Dec/10 8:23 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.