Ruby.tearDown is slow and causes bad performace of embedding API
-----------------------------------------------------------------
Key: JRUBY-4589
URL: http://jira.codehaus.org/browse/JRUBY-4589
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.5
Reporter: Yoko Harada
Attachments: CallMethodToCompare.java,
terminate_performance_improvement.patch
Ruby.tearDown() method, especially, localContext.set(null); line of
ThreadService.disposeCurrentThread() method is slow to execute and causes bad
performance of embedding API. ScriptingContainer calls tearDown in every
evaluation and calling method to execute at_exit blocks and clear states.
However, whole tearDown method is not necessary in every time. Attached patch
isolates execution of at_exit blocks from tearDown method. Also, the patch
isolates clearing thread context map to another method. These two are necessary
parts for embeddin API.
After the patch is applied, the performance has been improved from 344 to 105
milliseconds in the test case (the same one attached to JRUBY-4552).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email