cocos-engine
cocos-engine copied to clipboard
profiler use string_view as argument
Re: #
Changelog
Continuous Integration
This pull request:
- [ ] needs automatic test cases check.
Manual trigger with
@cocos-robot run test cases
afterward. - [ ] does not change any runtime related code or build configuration
If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.
Compatibility Check
This pull request:
- [ ] changes public API, and have ensured backward compatibility with deprecated features.
- [ ] affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
- [ ] affects file structure of the build package or build configuration which requires user project upgrade.
- [ ] introduces breaking changes, please list all changes, affected features and the scope of violation.
Interface Check Report
This pull request does not change any public interfaces !
Why change to use string_view
?
Why change to use
string_view
?
Reduce the temporarily allocated string objects and improve the performance of profiler.
Do you have any performance test data?
I ran bunny test with 50K nodes on PC, the FPS changed from 20 to 24 after applying string_view.
I profiled 2 function that created 100K temporary string objects per-frame.
It seems valuable. Please make sure if ccstd::pmr::string
can work with std::string_view.
It seems valuable. Please make sure if
ccstd::pmr::string
can work with std::string_view.
Yes. string_view works fine with pmr::string