I added a timing function around function processDebugMessage(o)
in debug-utils.js
and if I have not done something wrong, I cannot see a statistically consistent difference in performance of the following flow:
[{"id":"bb214363.bd86e","type":"inject","z":"1de5d2f8.1c869d","name":"","topic":"","payload":"many","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":120,"wires":[["35d1a878.be12e"]]},{"id":"35d1a878.be12e","type":"function","z":"1de5d2f8.1c869d","name":"","func":"var obj = {};\nlet n = 1000;\nfor(let i = 0; i < n; i++) {\n let key = '';\n for(let j = 0; j < 10; j++) {\n \t key += randLetter();\n }\n if(i % 10 == 0) {\n \t key = '_' + key;\n }\n obj[key] = key;\n}\n\n\nfor(let i = 0; i < 100; i++) {\n send(obj);\n}\n\n\n\n\n\nfunction randLetter() {\n let letters = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"];\n return letters[Math.floor(Math.random() * letters.length)];\n}","outputs":1,"noerr":0,"x":430,"y":120,"wires":[["3be20ccd.11e37c"]]},{"id":"3be20ccd.11e37c","type":"debug","z":"1de5d2f8.1c869d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":590,"y":120,"wires":[]},{"id":"961993a2.d4648","type":"inject","z":"1de5d2f8.1c869d","name":"","topic":"","payload":"little","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":180,"wires":[["ee893043.a81098"]]},{"id":"ee893043.a81098","type":"function","z":"1de5d2f8.1c869d","name":"","func":"var obj = {};\nlet n = 10;\nfor(let i = 0; i < n; i++) {\n let key = '';\n for(let j = 0; j < 10; j++) {\n \t key += randLetter();\n }\n if(i % 10 == 0) {\n \t key = '_' + key;\n }\n obj[key] = key;\n}\n\n\nfor(let i = 0; i < 100; i++) {\n send(obj);\n}\n\n\n\n\n\nfunction randLetter() {\n let letters = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"];\n return letters[Math.floor(Math.random() * letters.length)];\n}","outputs":1,"noerr":0,"x":430,"y":180,"wires":[["6930a424.bc7104"]]},{"id":"6930a424.bc7104","type":"debug","z":"1de5d2f8.1c869d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":590,"y":180,"wires":[]}]