PlanarityProfile

From Gnash Project Wiki

Jump to: navigation, search

PlanarityBig5.swf - SWF7 - md5:d7fa49098586b24085bc49eb96cb8e8f

Start the game, then click on the right-arrow on the bottom-left corner. Enter level '15' and press the 'skip' button. CPU goes up 100% till the level is constructed. Global instance list grows to 466 entries. Quit.

gprof reports most time spent in executing ActionScript.

Profile 1

It seems the Array class is doing something not recommendable...

Flat profile:

Each sample counts as 0.01 seconds.

 %   cumulative   self              self     total
time   seconds   seconds    calls  ms/call  ms/call  name
 8.29      0.30     0.30  3777543     0.00     0.00  gnash::string_table::find(std::string const&, bool)
 7.73      0.58     0.28  3367830     0.00     0.00  gnash::as_value::doubleToString(double)
 7.18      0.84     0.26  3370194     0.00     0.00  gnash::as_array_object::index_requested(unsigned int)
 5.52      1.04     0.20  3370194     0.00     0.00  double boost::lexical_cast<double, std::string>(std::string const&)
 4.42      1.20     0.16  3361554     0.00     0.00  gnash::as_array_object::set_member(unsigned int, gnash::as_value const&, unsigned int)
 4.42      1.36     0.16      491     0.33     2.26  gnash::array_new(gnash::fn_call const&)
 3.87      1.50     0.14  3360679     0.00     0.00  std::deque<gnash::as_value, std::allocator<gnash::as_value> >::_M_fill_insert(std::_Deque_iterator<gnash::as_value, gnash::as_value&, gnash::as_value*>, unsigned int, gnash::as_value const&)

...

From the call graph:

               0.00    0.00   20119/3777543     gnash::ActionExec::getObjectMember(gnash::as_object&, std::string const&, gnash::as_value&) <cycle 2> [239]
               0.00    0.00   27942/3777543     gnash::as_object::init_member(std::string const&, gnash::as_value const&, int, unsigned int) [123]
               0.00    0.00   43150/3777543     gnash::as_environment::get_variable_raw(std::string const&, std::vector<boost::intrusive_ptr<gnash::as_object>, std::allocator<boost::intrusive_ptr<gnash::as_object> > > const&, gnash::as_object**) const <cycle 2> [193]
               0.02    0.00  299072/3777543     gnash::character::getUserDefinedEventHandler(std::string const&) const <cycle 2> [94]
               0.27    0.00 3360647/3777543     gnash::array_new(gnash::fn_call const&) <cycle 2> [10]

[15] 8.3 0.30 0.00 3777543 gnash::string_table::find(std::string const&, bool) [15]

Profile 2

After dropping crazy code in Array class implementation:


Flat profile:

Each sample counts as 0.01 seconds.

 %   cumulative   self              self     total
time   seconds   seconds    calls  ms/call  ms/call  name
 8.97      0.04     0.04  3722641     0.00     0.00  boost::variant<boost::blank, double, bool, boost::intrusive_ptr<gnash::as_object>, gnash::as_value::SpriteProxy, std::string, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>::~variant()
 7.69      0.07     0.03   596367     0.00     0.00  gnash::iterator_find(boost::multi_index::multi_index_container<gnash::Property, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::composite_key<gnash::Property, boost::multi_index::member<gnash::Property, unsigned int, &(gnash::Property::mName)>, boost::multi_index::member<gnash::Property, unsigned int, &(gnash::Property::mNamespace)>, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type>, mpl_::na, mpl_::na>, boost::multi_index::ordered_unique<boost::multi_index::tag<gnash::PropertyList::oType, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::multi_index::member<gnash::Property, int, &(gnash::Property::mOrderId)>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<gnash::Property> >&, unsigned int, unsigned int)
 7.69      0.10     0.03      166     0.18     0.61  gnash::GC::collect()
 5.13      0.12     0.02  3707547     0.00     0.00  gnash::as_value::setReachable() const
 5.13      0.14     0.02      880     0.02     0.02  void agg::render_scanlines<agg::rasterizer_scanline_aa<agg::rasterizer_sl_clip<agg::ras_conv_int> >, agg::scanline_u8, agg::renderer_scanline_aa_solid<agg::renderer_base<agg::pixfmt_alpha_blend_rgba<agg::blender_rgba_pre<agg::rgba8, agg::order_bgra>, agg::row_accessor<unsigned char>, unsigned int> > > >(agg::rasterizer_scanline_aa<agg::rasterizer_sl_clip<agg::ras_conv_int> >&, agg::scanline_u8&, agg::renderer_scanline_aa_solid<agg::renderer_base<agg::pixfmt_alpha_blend_rgba<agg::blender_rgba_pre<agg::rgba8, agg::order_bgra>, agg::row_accessor<unsigned char>, unsigned int> > >&)
 5.13      0.16     0.02      711     0.03     0.07  gnash::as_array_object::~as_array_object()
 2.56      0.17     0.01  3902405     0.00     0.00  gnash::as_value::as_value(gnash::as_value const&)