Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-3233

need to optimize injections

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7
    • Component/s: None

      Description

      I want to check how this closure performs vs empty one:
      
      ignite.compute().affinityCall(xx, xx, new IgniteCallable<Object>() {
          @IgniteInstanceResource
          Ignite ignite;
          
          @SpringApplicationContextResource
          ApplicationContext ctx;
          
          Object bean1;
          Object bean2;
          
          
          @Override public Object call() throws Exception {
              bean1 = ctx.getBean(bean1class);
              bean2 = ctx.getBean(bean2class);
              
              return null;
          }
      });
      

      Closure above is 3 times slower than Noop closure. Injections should be optimized.

      I see the following options:

      1. Annotations
        1. Introduce SpringAware annotation and annotate each object that will need injection including SPI and internal stuff
        2. Support Spring Autowire annotation.
        3. I am not sure about the approach. We can use ApplicationContext.autowire() or generate and compile code that will do injections.
      2. Interfaces
        1. IgniteAware
        2. Spring ApplicationContext aware
        3. ...

      Implementor should suggest and back solution with microbenchmarks.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yzhdanov Yakov Zhdanov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: