columnToFieldIndex memorize func#407
Conversation
|
@paulquerna-okta You based your work on |
da98f55 to
aa82be2
Compare
|
@nelsam rebased onto master as requested |
mapping_test.go
Outdated
| BestFriends []string `db:"best_friends"` | ||
| } | ||
|
|
||
| func BenchmarkCcolumnToFieldIndex(b *testing.B) { |
There was a problem hiding this comment.
Minor spelling mistake here: Ccolumn should be Column
|
One other minor note: we've generally been using onpar for unit tests, for readability reasons. You can see the general structure in our dialect tests. The tests you've written here are perfectly reasonable as-is, but I thought I'd offer to let you change them before merge, if you'd like. Otherwise, I'll just merge this PR and then convert them when I find time. |
| Cache Cache | ||
| } | ||
|
|
||
| type Cache interface { |
There was a problem hiding this comment.
Could you add a doc comment here, just to satisfy golint?
|
Are there any plans to move this forward? We also noticed some bottlenecks related to |
Could be considered a way to supersede #406
Adds a Cache interface + uses it in
columnToFieldIndex. This can be simply backed by&sync.Map{}, or a more complex cache library like ristretto. No new deps, but still gets the same category of performance increases described in #406