feat: Json type optimization#2006
Merged
jachym-tousek-keboola merged 12 commits intomainfrom Sep 12, 2024
Merged
Conversation
|
|
||
| for i := 0; i < b.N; i++ { | ||
| // reqCtx needs to be created separately for each request, otherwise the parsed json is cached | ||
| reqCtx := recordctx.FromHTTP(time.Now(), &http.Request{Header: header, Body: io.NopCloser(strings.NewReader(body))}) |
Member
Author
There was a problem hiding this comment.
reqCtx caches the parsed json in case it is needed for other columns so we need to create a new one for each CSVValue call, otherwise json parsing is cached, making the benchmark irrelevant.
4f03b80 to
20c8459
Compare
| assert.Equal(t, `{"key1":"bar1","key2":["bar2","bar3"]}`, val) | ||
| } | ||
|
|
||
| func TestRenderer_Path_FormData_Scalar(t *testing.T) { |
Member
Author
There was a problem hiding this comment.
Extra tests for application/x-www-form-urlencoded since the original renderer implementation is no longer covered by json tests + the results changed because of ParseQuery improvements.
Matovidlo
reviewed
Sep 10, 2024
87f54d9 to
514f841
Compare
67159a4 to
b158a2e
Compare
7e5e06a to
8604191
Compare
Matovidlo
approved these changes
Sep 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: https://keboola.atlassian.net/browse/PSGO-734
Changes:
Benchmarks
The
BenchmarkColumn_Pathbenchmark is the relevant one here.Old implementation:
New implementation with
fastjson: