Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JRuby 1.2
-
Component/s: Compiler, Interpreter, Parser
-
Labels:None
-
Number of attachments :
Description
There appears to be a number of peephole optimizations we could add that may not add up to a lot of improvement, but could be useful under some circumstances. For example, a few I know of (Marcin may know more):
- Bare literals on a line are not executed
- Repeated retrievals of the same local variable with no intervening code are reduced to a single retrieval or not executed at all
- Repeated retrievals of an instance variable with no intervening code are reduced to a single retrieval
All of these tend to confound benchmarking, but they may also be easy for us to add to reduce (slightly) overhead in cases of badly-written code.
The optimizations listed are all done in the compiler, and we'll add smaller bounded-scope bugs for interpreter and parser as warranted.