#1691 chore: improve titleCasedName performance

Merged
lunny merged 2 commits from performance into master 3 days ago
appleboy commented 4 days ago
$ go test -bench="TitleCasedName" ./names/...
goos: darwin
goarch: amd64
pkg: xorm.io/xorm/names
BenchmarkTitleCasedNameOld-4      376286              3272 ns/op            2248 B/op          9 allocs/op
BenchmarkTitleCasedNameNew-4     1567888               763 ns/op             224 B/op          1 allocs/op
PASS
ok      xorm.io/xorm/names      5.394s

Signed-off-by: Bo-Yi Wu appleboy.tw@gmail.com

``` $ go test -bench="TitleCasedName" ./names/... goos: darwin goarch: amd64 pkg: xorm.io/xorm/names BenchmarkTitleCasedNameOld-4 376286 3272 ns/op 2248 B/op 9 allocs/op BenchmarkTitleCasedNameNew-4 1567888 763 ns/op 224 B/op 1 allocs/op PASS ok xorm.io/xorm/names 5.394s ``` Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
appleboy added 1 commit 4 days ago
1360686907 chore: improve titleCasedName performance
appleboy reviewed 4 days ago
names/mapper.go
@@ -115,2 +116,2 @@
if 'a' <= chr && chr <= 'z' {
chr -= ('a' - 'A')
if 'a' <= c && c <= 'z' {
c += 'a' - 'A'
appleboy commented 4 days ago

I will change to c -= 'a' - 'A'

I will change to `c -= 'a' - 'A'`
appleboy added 1 commit 4 days ago
1637507361 udpate
appleboy commented 3 days ago
Owner

something wrong with goproxy in China. https://drone.gitea.com/xorm/xorm/1081/1/12

something wrong with goproxy in China. https://drone.gitea.com/xorm/xorm/1081/1/12
lunny merged commit f071e5eb96 into master 3 days ago
lunny added the
kind/performance
label 3 days ago
appleboy added this to the 1.1.0 milestone 2 days ago
The pull request has been merged as f071e5eb96.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.