Skip to content
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

columnToFieldIndex memorize func #407

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

paulquerna-okta
Copy link

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

@nelsam
Copy link
Member

nelsam commented Dec 2, 2019

@paulquerna-okta You based your work on v3, but are sending a PR against master. Please rebase your work on top of master, without the added code from v3.

@paulquerna-okta
Copy link
Author

@nelsam rebased onto master as requested

mapping_test.go Outdated
BestFriends []string `db:"best_friends"`
}

func BenchmarkCcolumnToFieldIndex(b *testing.B) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor spelling mistake here: Ccolumn should be Column

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b9b8642

@nelsam
Copy link
Member

nelsam commented Dec 2, 2019

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a doc comment here, just to satisfy golint?

mmrath added a commit to mmrath/gorp that referenced this pull request May 30, 2020
@rafaeljusto
Copy link
Contributor

Are there any plans to move this forward? We also noticed some bottlenecks related to columnToFieldIndex. I can try working on the feedback comments if @paulquerna-okta doesn't mind.

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