You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/10/08 07:53:49 UTC

[GitHub] [shardingsphere-elasticjob] wwj-go edited a comment on issue #1546: Implement a new SPI mechanism to replace Java native SPI mechanism

wwj-go edited a comment on issue #1546:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1546#issuecomment-705395078


   @TeslaCN hi,thanks for your reply. I have read the code you said in https://github.com/apache/shardingsphere , and I find that someone have merge it into this project named `ElasticJobServiceLoader`. 
   Personally, from a performance perspective,I think its not a good design.
   1.` register(final Class<T> service)` just save the classes not instances,this is equivalent to saying that instantiation of java SPI is not necessary and is a waste.
   2. Every time call  `newServiceInstances(final Class<T> service)`  will reinstantiate all implements and for the caller like `ElasticJobListenerFactory、 JobErrorHandlerFactory`, just use one implement and discard the rest , it is a serious waste.
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org