-
-
Notifications
You must be signed in to change notification settings - Fork 210
Add ability to uglify generated code #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -2,6 +2,7 @@ | |||
|
|||
const fastSafeStringify = require('fast-safe-stringify') | |||
|
|||
var uglify = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems inconsistent between let
and var
in the code base. Which do you want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var
is better since is a little faster than let
, thanks! :)
bench.js
Outdated
const stringifyString = require('.')({ type: 'string' }) | ||
const stringify = require('.')(schema, { uglify: true }) | ||
const stringifyArray = require('.')(arraySchema, { uglify: true }) | ||
const stringifyString = require('.')({ type: 'string', uglify: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you include benchmarks for both uglified and non-uglified versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a nit.
Can you also update the benchmarks?
This is also conflicting for the other two PRs, can you rebase as well? |
@delvedor I think we can bump v1.0.0 when this lands, it has been pretty stable API-wise for the last releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Rebased and separate benchmark added plus updated readme. |
JSON.stringify obj x 1,774,593 ops/sec ±1.07% (90 runs sampled) | ||
fast-json-stringify obj x 4,976,369 ops/sec ±1.00% (89 runs sampled) | ||
JSON.stringify array x 3,288 ops/sec ±5.18% (82 runs sampled) | ||
fast-json-stringify array x 1,813 ops/sec ±10.21% (71 runs sampled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is worse, but that's #15, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we must definitely fix that issue :S
@@ -29,7 +29,8 @@ | |||
"long": "^3.2.0", | |||
"pre-commit": "^1.1.3", | |||
"standard": "^10.0.0", | |||
"tap": "^10.3.0" | |||
"tap": "^10.3.0", | |||
"uglify-es": "^3.0.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need the es variant to support const
in the code, btw
@SimenB would you like to help maintaining this library and join our team? |
@mcollina I'd love to join up! 🙂 |
I've sent you an invitation! |
@mcollina Something like this you had in mind?