CraftSim

CraftSim

2M Downloads

[Customer History] Performance woes

emptyrivers opened this issue ยท 0 comments

commented

TL;DR for folks looking for a solution - try clearing all customer history, and setting the auto-clear to be more aggressive.

Allowing the Customer History to grow too large causes intolerable performance problems when opening the Profession UI, even if the customer history module is not displayed.

This problem was measured using /perfy run OpenProfessionUIToSkillLine(2879) (on a character with Khaz Algar Jewelcrafting, of course):

baseline - 46,162 microseconds

craftsim_openProfPane cpu

baseline was measured after months of semi-religiously performing crafting orders on several characters mainly for knowledge points. During this time, patron & player orders were recorded, and auto-cleanup threshold was set to zero (i.e. disabled)

after clearing all history - 790 microseconds

craftsim_postclearALL cpu

You can actually see much of this flamegraph in the above one, it's just squeezed very tightly on the margins. In any case this almost completely solved the problem for me. There's still a very minor hitch on opening the tradeskill ui, but nowhere near as bad (and no wonder, given a ~98% reduction in the objective!)

after clearing history, then fulfilling a single crafting order - 797 microseconds

craftsim_oneRecord cpu

Very nearly the same as before. Subjectively, this felt identical to a fully cleared history.

Some other notes:

  • even when the entire customer history data is cleared, building the customer history UI seems to take some 280 microseconds, which seems like a long time to build a UI which displays no data.
  • looking closely at the single record display suggests that the marginal cost 1 record on for UI:UpdateDisplay is 80 microseconds. If we take that as ground truth and extrapolate, then the baseline flamegraph suggests that there were approximately 548 records in my saved variables. Unfortunately I didn't think to make a copy before clearing history so I can't confirm, but that at least passes the sniff test for me, considering how I was using the addon over the last few months.