-
Notifications
You must be signed in to change notification settings - Fork 62
Fixes #30 #117
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
Fixes #30 #117
Conversation
|
@ilopmar Can you please let me know if this is likely to be pulled? My company is going to work from a local fork in the meantime, but it our obvious long-term goal is to get back to this repo. Also, it would be nice to know whether the solution is feasible in the eyes of the maintainers. If there are flaws, I'd be willing to try again. Thanks in advance. |
|
Sorry to taking so long in responding. Are this changes backwards compatible or this breaks the compatibility? |
|
We are actually using org.grails.plugins:postgresql-extensions:4.6.8 and org.postgresql:postgresql:42.0.0. My PR is against master because we expect to update our library dependencies soon and would likely use org.grails.plugins:postgresql-extensions:6.x. Does that and the fact they have unit tests answer your question or do you need me to do further investigation against something specific? Thanks again. |
|
I'm asking because you're modifying how the backslash and the quotes are stored in the db, so I think this is a breaking change and I need to be careful with it. If you plan to upgrade to 6.x to have support for Hibernate 5.2, I can merge this into master and then release |
|
Forgive my ignorance, but I didn't understand that this parser class was modifying anything in the db. My intent was to work with an in-memory representation and treat the backslashes as part of the next token (when that token is the double-quote or backslash). I thought the scope of this solution was only for the caller. If there is a larger application of this parser that I'm missing please let me know. To answer your question, it would be great if you could merge this into a 6.1.0 release as well as a 4.8.0 release, but I don't want to be greedy. If I had to pick one, I prefer 6.1.0 so there is at least an eventual migration plan back to this repo. Thanks. |
|
Hi, I'm the one who raised the issue. |
|
@butters16 I'm sorry, you're right nothing changes on the database. It's been a while since I used this last time. |
I could benchmark a bit... but right now I'm stuck with version |
|
The change doesn't seem to complicated so I can ported also to that branch and release |
👌 |
Good suggestion,
So, this change does make the processing 6-7 times slower, but we are talking about the microsecond level, so that seems acceptable to me. I was using a very small example (see below), so maybe @jglapa can help stress test it. The alternative would be to modify the
I tried this as well, but it didn't make an improvement at 2.960 μs. It's possible something else is optimizing here, so I don't plan to make this change. Here's what I was using to get some metrics (although I had to remove the backslashes for testing the original code since that makes it thrown an exception): void "Performance"() {
expect:
for (int i = 0; i < 1000000; i++) {
HstoreParser parser = new HstoreParser('')
parser.setValue(/"key"=>"\"value\""/)
parser.asMap()
}
} |
|
@jglapa You reported this bug a long time ago. How have you been working around it since then, or are you doing something to avoid the backslashes in the data on the write side? |
Yeah, I wanted to fix this in the |
|
@butters16 Nothing more on your side. I'll try to merge it and release the new versions tonight. |
|
I've released the fix in |
|
Admittedly, the placeholders are a bit wonky, but the best way I could think to not touch the iterator logic.