Getting flag for the column via helper method #492
No reviewers
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#492
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "impr/column_flag"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Columns in the maps (such as
statement.columnMap
,statement.mustColumnMap
,statement.nullableMap
) are placed in lowercase.Each time, when there is need to get any flag from map, name of the column converts to lowercase. Every calling of
strings.ToLower
makes new allocations.As an example - all columns in function
statement.buildConds
are checking viastatement.mustColumnMap
(which is filled up only for update statements). This operation makes 2*columns_count unnecessary allocations.Simple way to fix it - is to make helper method for flag getting from the map via case insensitive keys comparison.
Benchmarks of the current realization and offered way above (simple flag getting from the map, 9 columns):