node-pg-native icon indicating copy to clipboard operation
node-pg-native copied to clipboard

Benchmarks between pg and pg-native

Open elhigu opened this issue 9 years ago • 6 comments

Is there any benchmarks, which would show how much performance difference between native and js implementation is?

elhigu avatar Mar 16 '16 09:03 elhigu

Realistically, very little. Using the latest version, getting even a 10% bump is optimistic.

vitaly-t avatar Aug 20 '16 00:08 vitaly-t

It's quite hard to figure out if one should or should not use it without benchmarks. Also, pg sends a warning if native is not available which doesn't help much.

joaomilho avatar Oct 24 '17 11:10 joaomilho

pg sends a warning if native is not available

It shouldn't. What is the warning?

vitaly-t avatar Oct 24 '17 12:10 vitaly-t

@vitaly-t This is the warning https://github.com/brianc/node-postgres/blob/master/lib/index.js#L52

johanhenrikssn avatar Oct 24 '17 12:10 johanhenrikssn

@johanhenrikssn that error is only displayed when you try to require native without having it installed.

I've been using it for years, and never saw any error or warning when you are not trying to use native bindings without having it installed first.

vitaly-t avatar Oct 24 '17 12:10 vitaly-t

I just recently made benchmarks and published a blog post. I was focusing on reading results in JSON, but it seems native is almost always slower. I think this is true always when there is anything to parse in JavaScript.

mitar avatar Jan 11 '19 18:01 mitar