This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: The sampling profiler is designed to grab 250 samples per second, but it wasn’t going nearly that fast, and the sampling times weren’t continuous (it would sometimes grab many samples in succession, then wait hundreds of milliseconds before the next sample). This slowness was due to time spent in traceback.extract_stack, which I believe had highly variable performance because of its use of the linecache. The fix (inspired by https://github.com/bdarnell/plop ) was to instead grab the stack information directly. This means that we no longer have the text of the lines at each stack frame, but that's probably ok (it only showed up in the tooltip anyway, and it's not provided by the instrumented profiler). With this change, the number of samples that we get on the homepage in dev_appserver increased from about 70 to about 300. With the “time.sleep” line removed, the new sampler is about 100x faster rather than 4x. Test Plan: Load the logged-in homepage in dev_appserver with sampling enabled. Make sure the render_learning_dashboard frames add up to something close to 100%. Reviewers: ben, chris Reviewed By: ben CC: alpert Differential Revision: http://phabricator.khanacademy.org/D6646
- Loading branch information