-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(3517): super-simplistic fix to avoid costly AST transforms when t… #4292
Conversation
d997115
to
d32fd49
Compare
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.
Look great, Jan!
Would it be possible to throw together a few test cases (along side some existing ones somewhere( which test case when the function has whitespace before/after, has ;
and is already an expression?
I had tried a quick test with a 500k docs view from https://gist.github.com/nickva/f4177e581a5ba275b854b9a5af875d84 and don't seem to recover the speedup yet. (Ignore the sizes the dtavg is the time to query the view in seconds, the script has Mainjs-1.8.5
js-78
js-91
With fix/3517-part7 PRjs-1.8.5
js-78 + fix/3517-part7
js-91 + fix/3517-part7
EDIT: Previously I didn't see the performance improvement and as @janl mentioned in couchdb-dev on Slack it's due to my script using here-docs for the reduce function which has an extra |
09237c2
to
6dc1364
Compare
After the latest update the speedup is apparent. With |
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.
+1
68ec080
to
538b394
Compare
6075207
to
18875d5
Compare
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.
Sadly I see make release
fail:
Installing CouchDB into rel/couchdb/ ...
==> rel (generate)
ERROR: sh(cp -R /Users/nvatama/asf/rel/../share/server/main-ast-bypass.js "/Users/nvatama/asf/rel/couchdb/share/server/main-ast-bypass.js")failed with return code 1 and the following output:
cp: /Users/nvatama/asf/rel/../share/server/main-ast-bypass.js: No such file or directory
ERROR: Unexpected error: rebar_abort
ERROR: generate failed while processing /Users/nvatama/asf/rel: rebar_abort
make: *** [release] Error 1
This is at commit sha
commit 9cbfd0904b8c68cad24021ac7d0ace6d3722154c (HEAD -> fix/3517-part7, origin/fix/3517-part7)
docs: document workaround
With a default installation on Linux systems, this is going to be | ||
``COUCHDB_QUERY_SERVER_JAVASCRIPT="/opt/couchdb/bin/couchjs /opt/couchdb/share/server/main-ast-bypass.js"`` |
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.
Wonder if a slightly unpleasant part here could be that an edit in bin/couchdb
, which is installed by rpm/deb packages, would make that that file unable to be updated automatically by subsequent package upgrades?
RPM would put updates in.rpmnew
files and deb, I think?, stops and prompts the user about what to do. Prompts are easy for desktops, but can be a pain for unattended upgrades.
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.
you can do this via env var, you don’t have to edit bin/couchdb
— that’s just where you get the original paths that are valid for your system
For me it works, I tried it from scratch.
will result in:
Git log:
|
@nickva good find, I’ll update the release script and docs to match (if the ast-bypass file does not exist for them, they don’t need it) |
hm, or rather, we should build it in all cases, it just won’t do anything on 1.8.5 |
d3507cb
to
b8fea9d
Compare
…hey are not needed
Builds an additional main js file for ast bypass.
…hey are not needed.
I’d also be okay with inventing a new “/* no-ast */” prefix that folks can opt into, say:
to be absolutely safe we don’t break anything.
Fixes #3517