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

feat: add ability to reset so the object can be reused #103

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

muktihari
Copy link
Owner

@muktihari muktihari commented Jan 12, 2024

Now Decoder and Encoder have the ability to Reset, the underlying storage will be reused reducing memory allocation.

benchmark:

goos: darwin
goarch: amd64
pkg: github.com/muktihari/fit/decoder
cpu: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
BenchmarkReset/benchmark_New()-4          419300        2475   ns/op      9632 B/op       6 allocs/op
BenchmarkReset/benchmark_Reset()-4       6264751         207.6 ns/op       120 B/op       3 allocs/op
goos: darwin
goarch: amd64
pkg: github.com/muktihari/fit/encoder
cpu: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
BenchmarkReset/benchmark_New()-4          1000000      1155   ns/op       2283 B/op      13 allocs/op
BenchmarkReset/benchmark_Reset()-4        6866968       168.6 ns/op         97 B/op       3 allocs/op

@muktihari muktihari added the enhancement New feature or request label Jan 12, 2024
@muktihari muktihari self-assigned this Jan 12, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c4128ca) 99.89% compared to head (23b3ec6) 99.90%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #103   +/-   ##
=======================================
  Coverage   99.89%   99.90%           
=======================================
  Files          43       43           
  Lines        3989     4038   +49     
=======================================
+ Hits         3985     4034   +49     
  Misses          4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@muktihari muktihari changed the title feat: add ability to reset to the object can be reused feat: add ability to reset so the object can be reused Jan 12, 2024
@muktihari muktihari merged commit 8026cb5 into master Jan 12, 2024
1 check passed
@muktihari muktihari deleted the feat/add-ability-to-reset branch January 12, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants