Open yamsellem opened 9 years ago
That's.. Interesting. Does it happend for all user-agent strings? Or just particular one?
We've noticed a 4% cpu overhead (on a 525req/sec server), so it may concerned a majority of strings.
It's odd as the only addition is new regular expressions and a re-order of the useragents.
Also seeing this drop in the suite:
~/g/f/u/benchmark (master|✚2…) $ node --version
v6.7.0
~/g/f/u/benchmark (master|✚2…) $ cat ../package.json | head -n 3
{
"name": "useragent",
"version": "2.1.9",
~/g/f/u/benchmark (master|✚2…) $ node run.js
Starting the benchmark, parsing 62 useragent strings per run
Executed benchmark against node module: "useragent"
Count (16), Cycles (4), Elapsed (5.516), Hz (273.25143832077316)
Executed benchmark against node module: "useragent_parser"
Count (32), Cycles (2), Elapsed (5.378), Hz (531.7064666225433)
Executed benchmark against node module: "useragent-parser"
Count (17), Cycles (5), Elapsed (5.587), Hz (253.35079923369597)
Executed benchmark against node module: "ua-parser"
Count (67), Cycles (3), Elapsed (5.371), Hz (1110.320560518609)
Module: "ua-parser" is the user agent fastest parser.
We've found a performance drop in our production code when migrating to release 2.1.7. Here is a benchmark that reproduces it:
On node 0.10.24 (tested on 0.10.39 with similar results)
On node 0.12.6 (tested on 0.12.0 with similar results)
Only one commit differs between the two releases, commit #dff0db related to issue #76.