使用 YUI 3 跟踪 jQuery.extend

Using YUI 3 to trace jQuery.extend

本文关键字:jQuery extend 跟踪 YUI 使用      更新时间:2023-09-26

我正在尝试使用 YUI 3 来跟踪应用程序中 jQuery 的性能。 IE8抱怨运行缓慢的脚本,在调试时似乎是jQuery(扩展函数)的内部脚本。

我已经设法让 YUI 使用以下代码跟踪 jQuery 的调用,但不能跟踪扩展函数本身:

//create new instance and load profiler
YUI().use("profiler", function(Y){
  Y.Profiler.registerConstructor("jQuery", window);
  window.YProfiler = Y.Profiler;
});

这跟踪对jQuery的特定调用,但不跟踪jQuery.extend - 根据IE的说法,这是导致问题的原因。

谢谢!

> 在 registerConstructor 后添加registerFunction

Y.Profiler.registerConstructor("jQuery", window);
Y.Profiler.registerFunction("jQuery.extend");

引用

  • YUI 分析器:注册功能