Open staltz opened 2 years ago
at seekKey (/home/jerome/dev/bipf/index.js:235:11)
at Array.eval (eval at createSeekPath (/home/jerome/dev/bipf/index.js:336:10), <anonymous>:6:11)
at /home/jerome/dev/bipf/index.js:452:27
at Object.<anonymous> (/home/jerome/dev/bipf/test/perf.js:166:3)
Something wrong with createCompareAt: the function produced is indeed not called the proper way in perf.js (with 4 args instead of 2, probably a confusion with bipf.compare)
Continuing from https://github.com/jerive/bipf-napi/issues/1#issuecomment-985868777
@jerive I noticed that in
test/perf.js
, sometimesseekKey(buffer, start, target)
is called withbuffer = 0
and that's what causes a deopt. We could do two things: (1) check why isbuffer = 0
being passed to this function in the perf.js, and not pass that (invalid) arg, (2) put aif (Buffer.isBuffer(buffer))
check in the implementation, although this will likely impact performance a tiny bit.