ZenKit icon indicating copy to clipboard operation
ZenKit copied to clipboard

[v2.0.0] Add benchmarks to allow for proper profiling

Open lmichaelis opened this issue 3 years ago • 5 comments

There is probably a lot of performance left on the table at the moment since it is not really possible to profile most parts of phoenix. Especially the script VM is critical to performance in Gothic re-implementations like OpenGothic.

Writing proper benchmarks will enable easier profiling of phoenix.

lmichaelis avatar Oct 03 '22 12:10 lmichaelis

Note about load-time performance: изображение

Animation::Sequence::Sequence in OpenGothic calls for Resources::vdfsIndex().find_entry twice, making total of 18% of load-time.

One fix is easy - use one call, instead of 2 - that is on me. Yet find_entry probably can be improved.

Try avatar Nov 06 '22 20:11 Try

Hm that's an interesting profile. I did one about a week ago and it actually showed that vdf_file::merge takes a long time to run. That is probably related to me using an unsorted Container for vdf_entry::_m_children. I'm looking into a better solution potentially using a set or a list.

lmichaelis avatar Nov 07 '22 05:11 lmichaelis

As expected, using a std::set with a custom, case-insensitive comparator, I see about 80x performance improvement in find_entry. That's exceptional! I'll have to find a way around std::set's const lookups but it seems like the only right way of doing things is to deprecate the non-const find_entry APIs. They could be re-added in the future because I'm planning a rework of the VDFS API anyways.

lmichaelis avatar Nov 07 '22 15:11 lmichaelis

@Try I'm keeping a bleeding-edge version of OpenGothic with the newest patches at lmichaelis/OpenGothic in the phoenix-bleeding branch. Feel free to pull/merge from there if you like as well :)

lmichaelis avatar Nov 07 '22 16:11 lmichaelis

Updated OpenGothic - very nice improvement of load-time performance, thanks!

Try avatar Nov 07 '22 17:11 Try