hsinclai has asked for the wisdom of the Perl Monks concerning the following question:
the answer looks like this:my $bytes_used = 0; foreach my $key ( @{ $response->{keys} } ) { $bytes_used += $key->{size}; } my $num_keys = commify($#{ $response->{keys} }); $bytes_used = commify($bytes_used); ...
Do you think this process can be made less CPU-intensive somehow?29,118 keys in bucket bla. 98,524,002,052 total bytes used in bucket bla.
So, this ran for about 35 minutes, and unfortunately crapped out with a parser error> dprofpp Total Elapsed Time = 2111.4 Seconds User+System Time = 2029.76 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 48.6 987.9 987.94 469469 0.0021 0.0021 XML::LibXML::NodeList::ne +w 48.2 979.3 979.37 469402 0.0021 0.0021 XML::LibXML::Literal::new 0.75 15.27 15.270 469402 0.0000 0.0000 XML::LibXML::XPathContext +::_find 0.50 10.25 29.390 469536 0.0000 0.0001 XML::LibXML::XPathContext +::_guarde d_find_call 0.42 8.430 992.83 469402 0.0000 0.0021 XML::LibXML::NodeList::to +_literal 0.35 7.130 1024.0 469402 0.0000 0.0022 XML::LibXML::XPathContext +::find 0.34 6.820 2026.5 469402 0.0000 0.0043 XML::LibXML::XPathContext +::findval 10 ue 0.25 5.030 5.030 335335 0.0000 0.0000 XML::LibXML::Node::string +_value 0.24 4.840 2034.3 68 0.0712 29.916 Net::Amazon::S3::list_buc +ket 0.14 2.820 2.820 469402 0.0000 0.0000 XML::LibXML::Literal::val +ue 0.07 1.420 1.420 469000 0.0000 0.0000 XML::LibXML::XPathContext +::getCont extNode 0.06 1.310 1.310 938000 0.0000 0.0000 XML::LibXML::XPathContext +::setCont extNode 0.05 0.930 0.930 402402 0.0000 0.0000 XML::LibXML::Node::DESTRO +Y 0.04 0.890 0.890 469536 0.0000 0.0000 XML::LibXML::XPathContext +::_free_n ode_pool 0.02 0.360 0.360 68 0.0053 0.0053 XML::LibXML::_parse_strin +g
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Module uses loads of CPU.. or is it me
by kyle (Abbot) on Dec 10, 2007 at 03:11 UTC | |
by Anonymous Monk on Dec 10, 2007 at 22:10 UTC | |
by hsinclai (Deacon) on Dec 11, 2007 at 02:45 UTC | |
Re: Module uses loads of CPU.. or is it me
by redhotpenguin (Deacon) on Dec 11, 2007 at 01:04 UTC | |
by hsinclai (Deacon) on Dec 11, 2007 at 01:36 UTC | |
by redhotpenguin (Deacon) on Dec 11, 2007 at 05:48 UTC | |
by hsinclai (Deacon) on Dec 11, 2007 at 13:34 UTC | |
by redhotpenguin (Deacon) on Dec 11, 2007 at 17:22 UTC | |
|