History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-2410
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Charles Oliver Nutter
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JRuby

Multiple assignment could be made faster by not returning unused array

Created: 18/Apr/08 02:58 PM   Updated: 18/Apr/08 02:58 PM
Component/s: Compiler, Interpreter
Affects Version/s: None
Fix Version/s: JRuby 1.1+

Time Tracking:
Not Specified


 Description  « Hide
Currently, multiple assignment returns an array of the RHS:
~/NetBeansProjects/jruby ➔ ruby -e "p((a, b, c = 1, 2, 3))"
[1, 2, 3]

If this new array is not used, it is wasted. So a simple optimization for this would be to only have the result of masgn produce an array iff there's a consumer for that result.

We should make this optimization in both the interpreter and compiler. Might be a good one for an interpreter or compiler newb to try out.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.