MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / profiling_collate_native_call_data

Method profiling_collate_native_call_data

modules/gdscript/gdscript.cpp:2500–2525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2498}
2499
2500void GDScriptLanguage::profiling_collate_native_call_data(bool p_accumulated) {
2501#ifdef DEBUG_ENABLED
2502 // The same native call can be called from multiple functions, so join them together here.
2503 // Only use the name of the function (ie signature.split[2]).
2504 HashMap<String, GDScriptFunction::Profile::NativeProfile *> seen_nat_calls;
2505 SelfList<GDScriptFunction> *elem = function_list.first();
2506 while (elem) {
2507 HashMap<String, GDScriptFunction::Profile::NativeProfile> *nat_calls = p_accumulated ? &elem->self()->profile.native_calls : &elem->self()->profile.last_native_calls;
2508 HashMap<String, GDScriptFunction::Profile::NativeProfile>::Iterator it = nat_calls->begin();
2509
2510 while (it != nat_calls->end()) {
2511 Vector<String> sig = it->value.signature.split("::");
2512 HashMap<String, GDScriptFunction::Profile::NativeProfile *>::ConstIterator already_found = seen_nat_calls.find(sig[2]);
2513 if (already_found) {
2514 already_found->value->total_time += it->value.total_time;
2515 already_found->value->call_count += it->value.call_count;
2516 elem->self()->profile.last_native_calls.remove(it);
2517 } else {
2518 seen_nat_calls.insert(sig[2], &it->value);
2519 }
2520 ++it;
2521 }
2522 elem = elem->next();
2523 }
2524#endif
2525}
2526
2527struct GDScriptDepSort {
2528 //must support sorting so inheritance works properly (parent must be reloaded first)

Callers

nothing calls this directly

Calls 9

firstMethod · 0.80
selfMethod · 0.80
splitMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
removeMethod · 0.45
insertMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected