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

Refactor struct's time to remove unnecessary memory usage #3142

Merged
merged 6 commits into from Dec 11, 2017

Conversation

lunny
Copy link
Member

@lunny lunny commented Dec 11, 2017

This PR will remove unnecessary time.Time on almost all the structs and define a new time type TimeStamp int64 to handle the time. It's also improve the TimeSince where converted to time.Time and convert back before. So that, many BeforeInsert and AfterLoad is still unnecessary. The code is more clean.

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Dec 11, 2017
@lunny lunny added this to the 1.4.0 milestone Dec 11, 2017
@appleboy
Copy link
Member

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 11, 2017
@codecov-io
Copy link

codecov-io commented Dec 11, 2017

Codecov Report

Merging #3142 into master will increase coverage by 0.1%.
The diff coverage is 63.1%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #3142     +/-   ##
=========================================
+ Coverage   34.66%   34.77%   +0.1%     
=========================================
  Files         275      276      +1     
  Lines       40030    39945     -85     
=========================================
+ Hits        13878    13889     +11     
+ Misses      24173    24058    -115     
- Partials     1979     1998     +19
Impacted Files Coverage Δ
modules/templates/helper.go 49.31% <ø> (-1.04%) ⬇️
models/login_source.go 8.45% <ø> (+0.07%) ⬆️
models/issue_watch.go 70.73% <ø> (+4.06%) ⬆️
models/notification.go 74.57% <ø> (-2.11%) ⬇️
models/repo_unit.go 45.83% <ø> (-2.17%) ⬇️
models/admin.go 81.63% <ø> (-0.73%) ⬇️
models/attachment.go 50% <ø> (-1.07%) ⬇️
models/branches.go 52.29% <ø> (-0.55%) ⬇️
models/webhook.go 67.47% <ø> (-0.18%) ⬇️
models/lfs.go 28.26% <ø> (+3.26%) ⬆️
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c082c3b...86814ab. Read the comment docs.

@lafriks
Copy link
Member

lafriks commented Dec 11, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 11, 2017
@lafriks lafriks merged commit f2e20c8 into go-gitea:master Dec 11, 2017
@lunny lunny deleted the lunny/improve_time branch December 11, 2017 05:35
daviian added a commit to daviian/gitea that referenced this pull request Jun 9, 2018
daviian added a commit to daviian/gitea that referenced this pull request Jun 10, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants