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

Improve memory storage #2162

Merged
merged 7 commits into from Oct 19, 2022
Merged

Improve memory storage #2162

merged 7 commits into from Oct 19, 2022

Conversation

ReneWerner87
Copy link
Member

@ReneWerner87 ReneWerner87 commented Oct 18, 2022

Description

until then it was not clear for which internal memory storage is used, this i tried to describe better and optimize the code for it

the code of the storages have been updated

i also provided functionalities which create timestamps more performant when needed

Type of change

Please delete options that are not relevant.

  • Code improvement

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I tried to make my code as fast as possible with as few allocations as possible
  • For new code I have written benchmarks so that they can be analyzed and improved

Commit formatting:

Use emojis on commit messages so it provides an easy way of identifying the purpose or intention of a commit. Check out the emoji cheatsheet here: https://gitmoji.carloscuesta.me/

@ReneWerner87
Copy link
Member Author

Memory storage optimized:

Benchmark_Memory/fiber_memory-12         	    7950	    153780 ns/op	     616 B/op	       0 allocs/op
Benchmark_Memory/fiber_memory-12         	    9714	    134795 ns/op	     657 B/op	       0 allocs/op
Benchmark_Memory/fiber_memory-12         	    9558	    122996 ns/op	     645 B/op	       0 allocs/op
Benchmark_Memory/fiber_memory-12         	    9392	    130914 ns/op	     635 B/op	       0 allocs/op
Benchmark_Memory/fiber_memory-12         	    8590	    123949 ns/op	     645 B/op	       0 allocs/op
Benchmark_Memory/fiber_memory-12         	    9662	    126010 ns/op	     703 B/op	       0 allocs/op

original storage:

Benchmark_Memory/fiber_memory-12         	    3972	    282395 ns/op	     662 B/op	       0 allocs/op
Benchmark_Memory/fiber_memory-12         	    4204	    279402 ns/op	     723 B/op	       0 allocs/op
Benchmark_Memory/fiber_memory-12         	    4239	    278725 ns/op	     619 B/op	       0 allocs/op
Benchmark_Memory/fiber_memory-12         	    4239	    302900 ns/op	     717 B/op	       0 allocs/op
Benchmark_Memory/fiber_memory-12         	    4288	    282079 ns/op	     703 B/op	       0 allocs/op
Benchmark_Memory/fiber_memory-12         	    4221	    280041 ns/op	     721 B/op	       0 allocs/op

@ReneWerner87 ReneWerner87 marked this pull request as ready for review October 19, 2022 11:15
@ReneWerner87
Copy link
Member Author

ReneWerner87 commented Oct 19, 2022

  • don´t forget to update the beta branch with the code

internal/storage/memory/memory_test.go Outdated Show resolved Hide resolved
@efectn
Copy link
Member

efectn commented Oct 19, 2022

  • don´t forget to update the beta branch with the code

Will merge it later

@ReneWerner87 ReneWerner87 merged commit ce2d087 into master Oct 19, 2022
@efectn efectn deleted the improve_memory_storage branch October 19, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants