Although a relative performance metric is important and a good starting point, it's by far the most overused checkpoint to stop something from being considered in programming, when in reality absolute numbers and context are the truth. It doesn't matter if, from a arbitrary 200ms from activity lifecycle start to deviceReady we increase it to 220ms to process annotations, and then have an extra 5ms on each call compared to 1ms from the pure call cost in a pool of 100ms per "request" (from js callsite to callback). That's a relative 5x increase in time taken per call, indeed, but a useless drop in the ocean near what's the total time of communication.
Readability and maintainability are very important aspects of a framework/protocol when the plugin author is an end user too. As a mere cordova user, I'd rather see this taken to a deeper level of consideration and benchmarking before discarding. 2018-05-01 0:22 GMT-03:00 Simon MacDonald <simon.macdon...@gmail.com>: > > > > On Mon, Apr 30, 2018 at 12:37 PM Wojciech Trocki <wtro...@gmail.com> > > wrote: > > > > Maybe I'm not understanding the goal here and it would be clearer with an > > example, but it looks like this would split each action out into its own > > class? I'm not sure what advantage there is to that, since you'd lose > > access to all the CordovaPlugin members like the webview and > > CordovaInterface. > > > > I agree with Darryl here, I'm not sure what that PR actually makes better? > It seems to make the problem worse. > > > > From a plugin author standpoint, a @CordovaMethod annotation to expose > > specific plugin methods to JS would be ideal, but it's not such a > > convenience that it's worth any performance hit. The string-based execute > > is clunky, but not all that much of a problem if you just use it to > > dispatch to other methods. > > > > If annotations are 5-6 times slower than normal method calls I think this > was a good idea that the OS can't handle. We are dealing with devices where > 100ms makes the difference between a "smoothly performing" app and a > "janky" app. > > Simon > -- *Frederico Galvão* Diretor de Tecnologia PontoGet Inovação Web ( +55(62) 8131-5720 * www.pontoget.com.br <http://www.pontoget.com/>