Tim Starling has submitted this change and it was merged.

Change subject: Added a very basic sampling profiler
......................................................................


Added a very basic sampling profiler

Added a sampling profiler with an interface that provides a function
aggregation. Testing indicates that it is fast enough to enable
unconditionally. I have a patch for Scribunto lined up that adds the
results to the limit report for slow pages (>1s).

Unfortunately it proved to be impossible to start and stop the timer
every time Lua was entered. With a typical test case, it would miss
about 50% of execution time and show a strong bias towards long-running
invocations, due to details of the latency between timer expiration and
signal delivery. So the timer will start the first time Lua is called,
and keep running until the LuaSandbox object is destroyed.

I made some efforts to provide a meaningful function name, slightly
beyond what Lua does by default.

I moved the signal handler deregistration to post-deactivate so that the
profiler would be stopped first.

Change-Id: I0b83a914ae993418b58a059003309f6c9bafd7de
---
M luasandbox.c
M luasandbox_timer.h
M luasandbox_types.h
M php_luasandbox.h
M timer.c
5 files changed, 439 insertions(+), 50 deletions(-)

Approvals:
  Tim Starling: Verified; Looks good to me, approved


--
To view, visit https://gerrit.wikimedia.org/r/22709
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b83a914ae993418b58a059003309f6c9bafd7de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/php/luasandbox
Gerrit-Branch: master
Gerrit-Owner: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to