You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The latest timings I posted in #269 show node 483 still faster with ibm_db than 6x/8x.
My app uses prepare and then execute and executeNonQuery millions of times per day. So I'm wondering if ibm_db using two js modules in the middle of all the fast C++ code, apparently on every call, can be optimized.
Remember what Ben said in #269 :
"Nothing really stands out but I noticed that lib/odbc.js is sloppy mode code. Adding a 'use strict' at the top might help, that gives V8 more leeway to optimize. The file needs to be strict mode compatible, of course, but I expect sloppy mode code will only get penalized more going forward so it pays to switch to strict mode."
MDN article has this quote:
"Certain language functions are so pervasive that performing runtime checks has considerable performance cost. A few strict mode tweaks, plus requiring that user-submitted JavaScript be strict mode code and that it be invoked in a certain manner, substantially reduce the need for those runtime checks." https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
Actually after adding the two "use strict" statements, then getting one error and commenting out "delete db", which didn't seem needed, benchmark ran fine.
With no change in timings. Oh well, go ahead and close.
The latest timings I posted in #269 show node 483 still faster with ibm_db than 6x/8x.
My app uses prepare and then execute and executeNonQuery millions of times per day. So I'm wondering if ibm_db using two js modules in the middle of all the fast C++ code, apparently on every call, can be optimized.
Remember what Ben said in #269 :
"Nothing really stands out but I noticed that lib/odbc.js is sloppy mode code. Adding a 'use strict' at the top might help, that gives V8 more leeway to optimize. The file needs to be strict mode compatible, of course, but I expect sloppy mode code will only get penalized more going forward so it pays to switch to strict mode."
I think the flamegraph I added in #269 shows these two js modules could use some speeding up: (you have to scroll way down)
https://cdn.rawgit.com/amcintyre99/18ba434153ed6646f9cf8b4e5afa2b74/raw/dacda1375f31f9e474ea9f319aee5b0b9a51aacb/perf1.svg
MDN article has this quote:
"Certain language functions are so pervasive that performing runtime checks has considerable performance cost. A few strict mode tweaks, plus requiring that user-submitted JavaScript be strict mode code and that it be invoked in a certain manner, substantially reduce the need for those runtime checks."
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
Found this jsperf which shows strict 7 times faster (ran on chrome 61):
https://jsperf.com/strict-mode-arguments
I tried making the changes myself but I couldn't get it working.
thanks!!
The text was updated successfully, but these errors were encountered: