Open pberkland opened 8 years ago
This may help but if the problem is string concatenation we have that throughout our code fro example
var Logger = require(EclairJS_Globals.NAMESPACE + '/Logger');
Is String.concat() in Nashorn any faster than using the + operator?
The current logging mechanism has huge performance impacts.
When something is done like "logger.debug('functionName -'+parmValue)"
this goes thru the expensive nashorn ADD function (to concatenate the string) before it is even determined if the logger is logging at that level. For the examples/mllib/largedataset.js example, it take 100s when logging is on in the Serialize.js, and only 50s when the logging is commented out.
We probably want something like "logger.debug('functionName',parmvalue)" and then within the logger implementation, first check if it is at the correct logging level, and if it is, do a string.join on the log parameters.