Skip to content

Conversation

halx99
Copy link
Collaborator

@halx99 halx99 commented Oct 10, 2022

THIS PROJECT IS IN DEVELOPMENT MODE. Any pull requests should merge to branch dev, otherwise will be rejected immediately

Describe your changes

ideas come from @denghe and @halx99

  • resize without filled
  • resize fit

Example code:

auto buf0 = std::vector<char>(128); // with zero filled and the real memory will large than required `128bytes`
auto buf1 = std::make_unique<char[]>(128); // alloc fit memory with zero filled
auto buf2 = std::make_unique_for_overwrite<char[]>(128); // alloc memory fit without zero filled.

Reference links

Issue ticket number and link

#915

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • I have checked readme and add important infos to this PR (if it needed).
  • An improved cpp-test/lua-test is not needed (explain why not, thanks).

@halx99 halx99 added the enhancement New feature or request label Oct 10, 2022
@halx99 halx99 added this to the 1.0 milestone Oct 10, 2022
@halx99 halx99 changed the title Improve code quality Improve code quality (step1. Oct) Oct 11, 2022
@halx99 halx99 linked an issue Oct 11, 2022 that may be closed by this pull request
1 task
@halx99 halx99 requested a review from crazyhappygame October 11, 2022 04:19
@halx99 halx99 requested a review from crazyhappygame October 11, 2022 15:11
@crazyhappygame
Copy link
Contributor

Do we have any benchmark to prove that those changes improve performance?

@halx99 halx99 added the pinned label Oct 12, 2022
@halx99
Copy link
Collaborator Author

halx99 commented Oct 12, 2022

Do we have any benchmark to prove that those changes improve performance?

Not have yet, maybe at next step

@halx99
Copy link
Collaborator Author

halx99 commented Oct 12, 2022

Do we have any benchmark to prove that those changes improve performance?

Not have yet, maybe at next step

I have test at local:

Debug

Before:

benchmark `Animation3D_init_1` of cost: 1.827(ms)
benchmark `Animation3D_init_2` of cost: 1.759(ms)
benchmark `Animation3D_init_3` of cost: 1.499(ms)

After:

benchmark `Animation3D_init_1` of cost: 0.402(ms)
benchmark `Animation3D_init_2` of cost: 0.295(ms)
benchmark `Animation3D_init_3` of cost: 0.235(ms)

Release

Before:

benchmark `Animation3D_init_1` of cost: 0.212(ms)
benchmark `Animation3D_init_2` of cost: 0.196(ms)
benchmark `Animation3D_init_3` of cost: 0.190(ms)

After:

benchmark `Animation3D_init_1` of cost: 0.092(ms)
benchmark `Animation3D_init_2` of cost: 0.087(ms)
benchmark `Animation3D_init_3` of cost: 0.074(ms)

@halx99 halx99 merged commit 39b57ae into dev Oct 13, 2022
@halx99 halx99 deleted the gcqi-oct-1 branch November 3, 2022 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants