in reply to Re: Optimizing a CHI-based data throttler
in thread Optimizing a CHI-based data throttler

Thanks, I'll remember this as one strategy to try. But first I'll do some profiling first.
  • Comment on Re^2: Optimizing a CHI-based data throttler

Replies are listed 'Best First'.
Re^3: Optimizing a CHI-based data throttler
by perlancar (Hermit) on Feb 24, 2020 at 01:26 UTC

    Preliminary profiling shows that indeed CHI is the bottleneck. 95% of the time is spent outside of Data::Throttler_CHI itself, while CHI::* code itself occupies at least ~73%; the rest of the overhead involves serialization, logging, and so on. Seems like reducing the number of cache item retrievals from CHI would be the primary strategy for speed-up. Or in other words, we need to cache CHI itself, thereby defeating its purpose in the first place :-)

    On the other hand, I manage to speed up Data::Throttler itself significantly simply by replacing Log::Log4perl with Log::ger. The Data::Throttler code logs a lot, so by removing logging statement (e.g. using Log::ger::Plugin::OptAway) we can cut the time into about one third!