Janino

Some performance optimizations

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.5.15
  • Component/s: None
  • Labels:
    None
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

This includes a bunch of optimzations. None of these optimizations were made blindly, they were all directly indicated by profiling.

  • Descriptor should use a map to cache common conversions
  • CodeContext should avoid allocating unneeded objects
  • CodeContext should double code size when growing it
  • Methods should be cached by name
  • switch finding LocalVariables to push the information down the tree eagerly instead of searching up it lazily
  • add the ability for SimpleCompiler to cook ASTs directly
  • UnitCompiler should push a local variable map through the tree
  • add more tests

Activity

Hide
Arno Unkrig added a comment -
  • Descriptor should use a map to cache common conversions
    v. good.
  • CodeContext should avoid allocating unneeded objects
  • CodeContext should double code size when growing it
    v. good.
  • Methods should be cached by name
    v. good.
  • switch finding LocalVariables to push the information down the tree eagerly instead of searching up it lazily
    v. good.
  • add the ability for SimpleCompiler to cook ASTs directly
    v. good.
  • UnitCompiler should push a local variable map through the tree
    v. good.
  • add more tests
    Modified "testByteArrayLiteral()" due to JANINO-117.

Please avoid the declaration of unnecessary exceptions!
Please try to obey the "Java Coding Conventions" regarding spaces before and after operators.

Show
Arno Unkrig added a comment -
  • Descriptor should use a map to cache common conversions v. good.
  • CodeContext should avoid allocating unneeded objects
  • CodeContext should double code size when growing it v. good.
  • Methods should be cached by name v. good.
  • switch finding LocalVariables to push the information down the tree eagerly instead of searching up it lazily v. good.
  • add the ability for SimpleCompiler to cook ASTs directly v. good.
  • UnitCompiler should push a local variable map through the tree v. good.
  • add more tests Modified "testByteArrayLiteral()" due to JANINO-117.
Please avoid the declaration of unnecessary exceptions! Please try to obey the "Java Coding Conventions" regarding spaces before and after operators.
Hide
Matt Fowles added a comment -

sorry about that. I try to copy the surrounding style whenever I can, but sometime I forget.

Show
Matt Fowles added a comment - sorry about that. I try to copy the surrounding style whenever I can, but sometime I forget.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: