Skip to content

Pointer scalars - #15

Merged
jamesls merged 2 commits into
jmespath:masterfrom
ejholmes:pointer-scalars
Feb 1, 2016
Merged

jamesls merged 2 commits into
jmespath:masterfrom
ejholmes:pointer-scalars

Conversation

@ejholmes

@ejholmes ejholmes commented Jan 2, 2016

Copy link
Copy Markdown
Contributor

This is a failing test for the cause of the issue mentioned in aws/aws-sdk-go#457 and #14.

I've added a potential implementation that fixes the tests, but I'm not super happy with having to type switch against all the basic scalars in Go.

@jamesls

jamesls commented Jan 4, 2016

Copy link
Copy Markdown
Member

Awesome, thanks. Out of curiosity, do you see any difference in the benchmarks?

@ejholmes

ejholmes commented Jan 5, 2016

Copy link
Copy Markdown
Contributor Author

Didn't run the benchmarks actually. I can do a before and after comparison later.

@jasdel

jasdel commented Jan 19, 2016

Copy link
Copy Markdown
Contributor

I ran a benchmark locally with this change and the tip of master. Overall it looks like a small improvement in performance. I also ran this with -benchmem and see zero change in memory usage.

With nested structs having the largest negative impact.

benchmark                                   old ns/op     new ns/op     delta
BenchmarkInterpretSingleFieldStruct-8       315           298           -5.40%
BenchmarkInterpretNestedStruct-8            1082          1034          -4.44%
BenchmarkInterpretNestedMaps-8              166           158           -4.82%
BenchmarkLexIdentifier-8                    635           589           -7.24%
BenchmarkLexSubexpression-8                 1179          1190          +0.93%
BenchmarkLexDeeplyNested50-8                10355         10091         -2.55%
BenchmarkLexDeepNested50Pipe-8              12017         11246         -6.42%
BenchmarkLexDeepNested50Index-8             16917         16173         -4.40%
BenchmarkLexQuotedIdentifier-8              2518          2392          -5.00%
BenchmarkLexQuotedIdentifierEscapes-8       2997          2896          -3.37%
BenchmarkLexRawStringLiteral-8              1601          1550          -3.19%
BenchmarkLexDeepProjection104-8             45501         44718         -1.72%
BenchmarkParseIdentifier-8                  800           794           -0.75%
BenchmarkParseSubexpression-8               1648          1642          -0.36%
BenchmarkParseDeeplyNested50-8              24430         23938         -2.01%
BenchmarkParseDeepNested50Pipe-8            23981         24644         +2.76%
BenchmarkParseDeepNested50Index-8           29413         29203         -0.71%
BenchmarkParseQuotedIdentifier-8            2761          2740          -0.76%
BenchmarkParseQuotedIdentifierEscapes-8     3181          3260          +2.48%
BenchmarkParseRawStringLiteral-8            1846          1867          +1.14%
BenchmarkParseDeepProjection104-8           99096         99324         +0.23%

@jamesls

jamesls commented Jan 19, 2016

Copy link
Copy Markdown
Member

@jasdel Thanks. Does this overall approach look good to you?

@jasdel

jasdel commented Jan 29, 2016

Copy link
Copy Markdown
Contributor

The change looks good for this test case which is great and it does fix this bug with jpgo, but I don't think it addresses the issue found in aws/aws-sdk-go#457. We'll need to fix that separately.

@ejholmes

Copy link
Copy Markdown
Contributor Author

@jasdel This specifically solves the issue mentioned in that PR.

@jamesls

jamesls commented Feb 1, 2016

Copy link
Copy Markdown
Member

Alright, I'll go ahead and merge this in, and then pick up any additional work.

@jamesls
jamesls merged commit 5141b76 into jmespath:master Feb 1, 2016
jamesls added a commit that referenced this pull request Feb 1, 2016
Fixed the length() function to work with a slice
of structs.

The entire functions.go will need an audit to update
the code to not assume slice of empty interface.

Related: #15.
@jamesls

jamesls commented Feb 2, 2016

Copy link
Copy Markdown
Member

Looks like there was an unintended side effect of this pull request mentioned in #20. I'm going to have to revert this commit. As an alternative, it looks like #18 fixes the original issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants