Новости | FAQ | Авторы | Документация | В действии | Библиотека |
Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
nkostya 16.06.2010 19:58
BEFORE load - на начало цикла[BEFORE load] {"used" => "4508", "free" => "268", "ever_allocated_since_compact" => "2200.77", "ever_allocated_since_start" => "8103.62"} [BEFORE _request API] {"used" => "4516", "free" => "260", "ever_allocated_since_compact" => "2233.22", "ever_allocated_since_start" => "8136.08"} [AFTER _request API] {"used" => "11200", "free" => "2508", "ever_allocated_since_compact" => "9954.66", "ever_allocated_since_start" => "15857.5"} [AFTER xml2hash] {"used" => "14024", "free" => "4264", "ever_allocated_since_compact" => "57555.8", "ever_allocated_since_start" => "304741"} [AFTER load] {"used" => "14512", "free" => "3776", "ever_allocated_since_compact" => "59245.5", "ever_allocated_since_start" => "306431"} [AFTER import] {"used" => "25168", "free" => "7352", "ever_allocated_since_compact" => "20328.9", "ever_allocated_since_start" => "669705"} [BEFORE load] {"used" => "25392", "free" => "7128", "ever_allocated_since_compact" => "21218.2", "ever_allocated_since_start" => "670594"} [BEFORE _request API] {"used" => "25396", "free" => "7124", "ever_allocated_since_compact" => "21250.5", "ever_allocated_since_start" => "670626"} [AFTER _request API] {"used" => "32552", "free" => "8160", "ever_allocated_since_compact" => "29154", "ever_allocated_since_start" => "678530"} [AFTER xml2hash] {"used" => "31844", "free" => "8868", "ever_allocated_since_compact" => "16770.5", "ever_allocated_since_start" => "967607"} [AFTER load] {"used" => "31928", "free" => "8784", "ever_allocated_since_compact" => "18459.7", "ever_allocated_since_start" => "969296"}Код функции преобразования xml -> hash
############################################################################## @_xml2hash[xNode] ^switch($xNode.nodeType){ ^case(1){ $result[^hash::create[]] $list[^xNode.select[*]] ^switch(true){ ^case($xNode.nodeName eq "ids"){ ^for[i](0;$list-1){ $node[$list.$i] $result.[$i][^_xml2hash[$node]] } } ^case(^xNode.getAttribute[type] eq "array"){ ^for[i](0;$list-1){ $node[$list.$i] $result.[$i][^_xml2hash[$node]] } } ^case[DEFAULT]{ ^for[i](0;$list-1){ $node[$list.$i] $result.[$node.nodeName][^_xml2hash[$node]] } } } ^if(!$list){ $result[^xNode.selectString[string(.)]] } } ^case(3){ $result[$xNode.nodeValue] } ^case(9){ $result[^_xml2hash[$xNode.documentElement]] } ^case[DEFAULT]{ ^throw[...;...] } } ^Rusage:compact[] #end @_xml2hash[]Никто не тестировал расход памяти на создание хеша, расход памяти на копирование хеша, расход памяти на создание класса с хешем?