Open ppisar opened 9 years ago
Hope we can get this accepted and released this quarter, it'd be a big help for the MongoDB libbson project if we can use the standard YAJL API instead of hacking into YAJL's internals.
Seems @lloyd is not available.
Hi @lloyd, I could really use some response to this request. I am willing to help in any way you like, whatever you require to prevent you from doing too much work.
hrm. this patch doesn't seem like it would properly re-initialize lexer state?
Also, to be clear, the motivation for this patch is performance? Reallocation of the yajl parser for distinct documents is slowing you down?
Yes, we're trying to avoid reallocation when we go from one document to the next, parsing something like:
{"a": 1}{"a": 2}
ok, give me a minute to hand you a patch on a branch to review.
Great! Yeah, I'm looking just a little more deeply at this, and it seems some of the lexer's state should be cleared. This is enough for libbson's use case:
yh->stateStack.used = 0;
yajl_bs_push (yh->stateStack, yajl_state_start);
... but it's not fully correct for other users.
@ajdavis how's this look? 646b8b82ce5441db3d11b98a1049e1fcb50fe776
Thanks, let me test this with libbson
:+1:
So far so good. One thing I've wondered about is whether we properly report the error location if we encounter a syntax error after the first document, so I'll add a test for that and report back again. =)
There's some work to do regarding properly showing the location of a parse error (the (right here) ------^
message) but I'm pretty sure the problem's in libbson, not YAJL.
So LGTM!
ok, I'll merge down and roll a new release within a day.
hey @lloyd would you consider adding other maintainers?
Thank you very much for implementing the yajl_reset(). I'm looking forward for the new release.
I would absolutely consider additional maintainers. Who's interested?
--lloyd
On Sep 25, 2015, at 10:21 AM, Lamont Granquist notifications@github.com wrote:
hey @lloyd would you consider adding other maintainers?
— Reply to this email directly or view it on GitHub.
I'd like to try, if you'd provide me with some guidance when I need it.
On Thursday, October 1, 2015, Lloyd Hilaiel notifications@github.com wrote:
I would absolutely consider additional maintainers. Who's interested?
--lloyd
On Sep 25, 2015, at 10:21 AM, Lamont Granquist <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:
hey @lloyd would you consider adding other maintainers?
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHub https://github.com/lloyd/yajl/issues/161#issuecomment-144904557.
I'm definitely interested. I'm the primary author of http://github.com/chef/ffi-yajl and would like to get some of the windows build stuff into better shape and stop maintaining internal patches at the very least...
ok, I'll merge down and roll a new release within a day.
@lloyd any news about this ?
@lloyd ping?
:+1: I also implemented this in #177 but am deferring to this PR to be merged.
@lloyd Are there any news to merge the patch in the master branch and roll a new release ? Without this release, it is impossible to integrate some libraries in distributions.
Is there a problem with maintenance of yajl ? It seems that there are some developers ( @lamont-granquist, @ppisar ) that would be happy to maintain it.
It would be great if yajl was maintained so that it can be added in distributions like RHEL. (there is currently no yajl-devel package)
libbons project currently bundles yajl because it needs to support recovering from yajl parsing failures by resetting the byte stack. See [https://jira.mongodb.org/browse/CDRIVER-597].
Followin patch adds yajl_reset_stack() public function which could satisfy libbson need: