Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Consider the use of defer #23

Closed
vic3lord opened this issue Aug 21, 2018 · 4 comments
Closed

Consider the use of defer #23

vic3lord opened this issue Aug 21, 2018 · 4 comments
Assignees
Labels
code style about code style enhancement New feature or request level:expert issues that requires expert knowledge
Milestone

Comments

@vic3lord
Copy link
Contributor

Description

Since this project aims to be a fast in memory database, it is better to eliminate the use of defer.
defer is nice for code readability where the Open and Close operations are close to each other and prevents to from forgetting to Close() but it has a performance penalty.

Steps to reproduce the behavior:

Expected behavior

OS and Other informations

Additional details

See: https://bytes-and-bites.com/posts/defer-go-performance/

@kasvith kasvith self-assigned this Aug 21, 2018
@kasvith kasvith added enhancement New feature or request level:beginner issue level beginner labels Aug 21, 2018
@kasvith
Copy link
Owner

kasvith commented Aug 21, 2018

This will be optimized using manual locking and unlocking.
Also DB needs RWMutex too

@kasvith kasvith added this to To do in Creating Basic Server via automation Aug 21, 2018
@kasvith kasvith added this to the First Release milestone Aug 21, 2018
@kasvith kasvith added level:expert issues that requires expert knowledge code style about code style and removed level:beginner issue level beginner labels Aug 22, 2018
@kasvith
Copy link
Owner

kasvith commented Aug 25, 2018

Removed defer from DB by #71

@kasvith
Copy link
Owner

kasvith commented Aug 25, 2018

PR #74 can you check it @vic3lord

@kasvith
Copy link
Owner

kasvith commented Aug 25, 2018

Closing by #74

@kasvith kasvith closed this as completed Aug 25, 2018
Creating Basic Server automation moved this from To do to Done Aug 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
code style about code style enhancement New feature or request level:expert issues that requires expert knowledge
Projects
Development

No branches or pull requests

2 participants