What do the “Not optimized” warnings in the Chrome Profiler mean?

前端 未结 5 1518
失恋的感觉
失恋的感觉 2021-01-30 16:20

When I use the Developer Tools in Chrome to collect JavaScript CPU Profiles, I am getting two mysterious warnings on functions:

  • Not optimized: optimized too many t
5条回答
  •  长发绾君心
    2021-01-30 16:27

    I had a

    function generate_year_blob(year,action,callback){ ... do_blob({act: action, cb:callback, ...}) ... }

    and I called it always using only one parameter like this generate_year_blob(this_year).

    Those action (expected to be string) and callback (expected to be function) were passed to do_blob() function.

    When I changed the the call from generate_year_blob(this_year) to generate_year_blob(this_year,'',null), the 'Not optimized: optimized too many times' warning disappeared.

    I didn't find this out immediately, because there were many similar functions generate_month_blob(...), generate_day_blob(...) etc. which were called with all parameters defined.

提交回复
热议问题