RPG Maker VXAce Profiler

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
RPG Maker VXAce Profiler
 ​
Introduction
Primarily a scripter's tool. It helps you check out the performance of your game and is a lot more accurate than FPS relative values.
This script is made with Neonblack :)
 
% time 
The percent of the time spent inside the procedure itself (not counting children). 
cumulative seconds 
The total number of seconds spent in the procedure, including children. 
self seconds 
The total number of seconds spent in the procedure itself (not counting children). 
calls 
The total number of times the procedure was called. 
self ms/call 
The average time taken by the procedure itself on each call, in ms. 
total ms/call 
The average time taken by each call to the procedure, including time spent in child functions.
 
Screenshots


How to Use
Put this script below all other scripts but above main. 
Press CTRL to print to Console the results. 
 
Warning, it starts the game slow (like 0-4 FPS even) but it's accurate in performance display.
If graphics.update is skipped it means the game has a major lagspike on normal run. 

Code:
module CP_Profiler  @@stacks = {}  @@maps = {}  @@start = 0    def self.begin    @@stacks = {}    @@maps = {}    @@start = Process.times[0]    set_trace_func proc { |event, file, line, id, binding, klass|    case event    when "c-call", "call"      now = Process.times[0]      stack = (@@stacks[Thread.current] ||= [])      stack.push [now, 0.0]    when "c-return", "return"      now = Process.times[0]      key = "#{klass}##{id}"      stack = (@@stacks[Thread.current] ||= [])      if tick = stack.pop        threadmap = (@@maps[Thread.current] ||= {})        data = (threadmap[key] ||= [0, 0.0, 0.0, key])        data[0] += 1        cost = now - tick[0]        data[1] += cost        data[2] += cost - tick[1]        stack[-1][1] += cost if stack[-1]      end    end    }  end    def self.print    set_trace_func nil    total = Process.times[0]    total = 0.01 if total == 0    totals = {}    @@maps.values.each do |threadmap|      threadmap.each do |key,data|        total_data = (totals[key] ||= [0, 0.0, 0.0, key])        total_data[0] += data[0]        total_data[1] += data[1]        total_data[2] += data[2]      end    end    data = totals.values    data = data.sort_by{ |x| -x[2] }    sum = 0    puts sprintf "     %%   cumulative   self              self     total\n"    puts sprintf "    time   seconds   seconds    calls  ms/call  ms/call  name\n"    for d in data      break if d[2] <= 0.0      sum += d[2]      puts sprintf "%8.2f %8.2f  %8.2f %8d %8.2f %8.2f  %s\n",          d[2]/total*100, sum, d[2], d[0], d[2]*1000/d[0], d[1]*1000/d[0], d[3]    end    msgbox "Results printed to console.\nTracking reset."  endendclass Scene_Base  alias_method :cp_profiler_342341_update, :update  def update(*args)    cp_profiler_342341_update(*args)    if Input.trigger?(:CTRL)      CP_Profiler.print      CP_Profiler.begin    end  endendCP_Profiler.begin
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
Hum interesting useful for prevent Lags produce by bad calculation : > !
 
Last edited by a moderator:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
Interesting....

Let me test this out on my battle system script...

I feel like I already made a lot of non-efficient process on it

EDIT:

Since the console itself is somehow not so really good for tracking purpose, I modified it so I can check in the external text file

module CP_Profiler @@stacks = {} @@maps = {} @@start = 0 def self.begin @@stacks = {} @@maps = {} @@start = Process.times[0] set_trace_func proc { |event, file, line, id, binding, klass| case event when "c-call", "call" now = Process.times[0] stack = (@@stacks[Thread.current] ||= []) stack.push [now, 0.0] when "c-return", "return" now = Process.times[0] key = "#{klass}##{id}" stack = (@@stacks[Thread.current] ||= []) if tick = stack.pop threadmap = (@@maps[Thread.current] ||= {}) data = (threadmap[key] ||= [0, 0.0, 0.0, key]) data[0] += 1 cost = now - tick[0] data[1] += cost data[2] += cost - tick[1] stack[-1][1] += cost if stack[-1] end end } end def self.print set_trace_func nil total = Process.times[0] total = 0.01 if total == 0 totals = {} @@maps.values.each do |threadmap| threadmap.each do |key,data| total_data = (totals[key] ||= [0, 0.0, 0.0, key]) total_data[0] += data[0] total_data[1] += data[1] total_data[2] += data[2] end end data = totals.values data = data.sort_by{ |x| -x[2] } sum = 0 File.open('profiller.txt', 'w') do |file| text = sprintf " %% cumulative self self total\n" file.print(text) text = sprintf " time seconds seconds calls ms/call ms/call name\n" file.print(text) for d in data break if d[2] <= 0.0 sum += d[2] text = sprintf "%8.2f %8.2f %8.2f %8d %8.2f %8.2f %s\n", d[2]/total*100, sum, d[2], d[0], d[2]*1000/d[0], d[1]*1000/d[0], d[3] file.print(text) end msgbox "Results printed to profiller.txt.\nTracking reset." end endendclass Scene_Base alias_method :cp_profiler_342341_update, :update def update(*args) cp_profiler_342341_update(*args) if Input.trigger?:)CTRL) CP_Profiler.print CP_Profiler.begin end endendCP_Profiler.begin 
And yes, it's provide better informations

 
Last edited by a moderator:

Yin

Veteran
Veteran
Joined
Jul 18, 2012
Messages
133
Reaction score
50
First Language
English
Primarily Uses
N/A
Interesting, thank you. I hope it works out for me!
 

Kaelan

Veteran
Veteran
Joined
May 14, 2012
Messages
797
Reaction score
537
First Language
Portuguese
Primarily Uses
RMMV
I think this would be better if there was some kind of extended call breakdown. Like, when I get this:

     %   cumulative   self              self     total    time   seconds   seconds    calls  ms/call  ms/call  name   22.22    13.88     13.88     5331     2.60     5.34  Hash#each_value   13.64    22.39      8.52     2832     3.01     3.01  Graphics#fps_update    6.55    26.49      4.09    13856     0.30     0.87  Range#each    5.36    29.84      3.35   683813     0.00     0.00  Win32API#call    4.60    32.71      2.87   343810     0.01     0.01  Fixnum#==    4.47    35.50      2.79   984385     0.00     0.00  Hash#[]=    3.02    37.39      1.89   596447     0.00     0.00  Array#[]=    2.88    39.19      1.80       15   119.87   198.67  Marshal#load    1.72    40.26      1.07   326026     0.00     0.00  BasicObject#==    1.66    41.30      1.04    30516     0.03     0.40  Array#each    1.52    42.25      0.95   258147     0.00     0.00  IO#getbyte    1.22    43.01      0.76      657     1.16     1.21  Bitmap#fyx_initialize_save_name    0.85    43.54      0.53        3   176.67   176.67  Graphics#transition    0.73    44.00      0.46     3103     0.15     0.37  Hash#each    0.65    44.40      0.40     3680     0.11     0.26  Game_Event#near_the_screen?    0.63    44.79      0.39    12877     0.03     0.04  Input#trigger?    0.60    45.17      0.38     4890     0.08     0.34  Sprite_Character#update_position    0.53    45.50      0.33      291     1.13     1.13  Window#windowskin=    0.53    45.82      0.33        1   328.00   328.00  Bitmap#blur    0.52    46.15      0.33     3897     0.08     0.13  Array#eql?    0.52    46.48      0.33    11396     0.03     0.05  Window_Base#update_tone    0.52    46.80      0.33    11499     0.03     0.06  Mouse#screen_to_client    0.50    47.12      0.31    11499     0.03     0.13  Mouse#pos    0.49    47.43      0.31    11499     0.03     0.04  Mouse#global_pos    0.49    47.74      0.31     5664     0.05     3.44  Graphics#update    0.44    48.01      0.28     4126     0.07     0.12  Array#hash    0.43    48.28      0.27     4890     0.05     0.66  Sprite_Character#update    0.42    48.55      0.27        1   265.00   265.00  Graphics#fadeout    0.41    48.80      0.25     1771     0.14     0.21  KDEA::UI::Window_ScrollArrows#process_ok    0.40    49.05      0.25     5050     0.05     0.09  Sprite_Base#update    0.37    49.28      0.23    13940     0.02     0.02  Game_Map#adjust_x    0.35    49.50      0.22    17252     0.01     0.01  Array#==    0.35    49.72      0.22    12551     0.02     0.08  Sprite_Character#update_src_rect    0.35    49.94      0.22    60085     0.00     0.00  Proc#call    0.33    50.14      0.20     9940     0.02     0.09  Game_CharacterBase#screen_y    0.33    50.34      0.20     8495     0.02    14.80  Scene_Base#update    0.32    50.55      0.20     2836     0.07     0.32  Sprite_Mouse#update    0.32    50.75      0.20     7077     0.03     0.28  Window_Selectable#process_handling    0.30    50.94      0.19    13940     0.01     0.02  Game_Map#adjust_y    0.30    51.12      0.19    11258     0.02     0.07  Window_Base#update    0.30    51.31      0.19     9940     0.02     0.03  Game_CharacterBase#jump_height    0.28    51.48      0.17    38294     0.00     0.00  Kernel#nil?    0.28    51.65      0.17     2174     0.08     0.17  Bitmap#font=    0.28    51.82      0.17    12705     0.01     0.02  Window_Selectable#cursor_movable?    0.28    52.00      0.17     1050     0.16     0.25  Font#to_a    0.27    52.17      0.17     2879     0.06     0.30  Integer#times    0.27    52.34      0.17     9600     0.02     0.35  Game_CharacterBase#update    0.25    52.49      0.16    49797     0.00     0.00  Window#visible    0.25    52.65      0.16     7295     0.02     0.02  Kernel#eval    0.25    52.80      0.15     8663     0.02     0.17  Mouse#trigger?    0.23    52.94      0.14    31176     0.00     0.00  Float#eql?    0.23    53.08      0.14    32976     0.00     0.00  Float#hash    0.22    53.22      0.14    11499     0.01     0.02  Mouse#hwnd    0.20    53.35      0.13     4890     0.03     0.04  Sprite_Character#update_other    0.20    53.48      0.13     2836     0.04     0.31  Mouse#update    0.20    53.60      0.12    12866     0.01     0.46  Window_Selectable#update    0.20    53.72      0.12     4984     0.02     0.16  Window_Selectable#process_mouse_handling    0.18    53.84      0.11     5718     0.02     0.02  Comparable#between?    0.18    53.95      0.11     4800     0.02     0.08  Game_CharacterBase#update_animation    0.18    54.06      0.11     5672     0.02     4.80  Input#update    0.18    54.17      0.11     5664     0.02    14.60  Scene_Base#update_basic    0.18    54.28      0.11    20717     0.01     0.01  Game_Map#height    0.17    54.39      0.11     9940     0.01     0.03  Game_CharacterBase#shift_y    0.17    54.49      0.11     9940     0.01     0.01  Sprite_Base#animation?    0.17    54.60      0.11     4800     0.02     0.02  Game_CharacterBase#update_anime_count    0.15    54.70      0.10     3628     0.03     0.04  Scene_Base#scene_changing?    0.15    54.79      0.10    23158     0.00     0.00  Window#active    0.15    54.89      0.09    18728     0.01     0.01  Graphics#height    0.15    54.98      0.09     2832     0.03     2.06  Scene_Base#update_all_windows    0.15    55.07      0.09     1833     0.05     0.12  Window_Selectable#item_rect    0.15    55.17      0.09     2832     0.03     0.15  Graphics#fps_sprite    0.15    55.26      0.09     9940     0.01     0.03  Game_CharacterBase#screen_x    0.15    55.35      0.09    19015     0.00     0.00  String#[]    0.15    55.44      0.09     5280     0.02     0.04  Game_CharacterBase#real_move_speed    0.13    55.52      0.08    18428     0.00     0.00  Kernel#instance_variable_get    0.12    55.60      0.08     4890     0.02     0.03  Sprite_Character#update_bitmap    0.12    55.68      0.08     7077     0.01     0.03  Window_Selectable#process_cursor_move    0.12    55.76      0.08    23017     0.00     0.00  String#unpack    0.12    55.84      0.08      907     0.09     0.10  Font#initialize    0.12    55.91      0.08     9982     0.01     0.02  Game_CharacterBase#object_character?    0.12    55.99      0.08    19975     0.00     0.00  Kernel#is_a?    0.12    56.07      0.08     5846     0.01     0.02  Time#now    0.12    56.14      0.08    11558     0.01     0.01  Tone#set    0.12    56.22      0.08    21711     0.00     0.00  Hash#default    0.12    56.30      0.08     5050     0.02     0.03  Sprite_Base#update_animation    0.10    56.36      0.06    22998     0.00     0.00  Array#pack    0.10    56.42      0.06     9197     0.01     0.01  Array#include?    0.10    56.49      0.06     2832     0.02     0.03  Comparable#==    0.10    56.55      0.06    20618     0.00     0.00  Kernel#hash    0.10    56.61      0.06     1172     0.05     0.12  Array#select    0.10    56.68      0.06     5934     0.01     0.01  Rect#set    0.10    56.74      0.06    13942     0.00     0.00  Game_Map#loop_horizontal?    0.10    56.80      0.06    10451     0.01     0.01  SceneManager#scene    0.10    56.87      0.06      295     0.21     0.43  Window_Base#create_contents    0.10    56.93      0.06     5531     0.01     0.01  Rect#width    0.10    56.99      0.06     7650     0.01     0.02  Enumerable#min    0.10    57.05      0.06     1821     0.03     0.03  Bitmap#blt    0.10    57.12      0.06     2093     0.03     1.58  KDEA::UI::Window_Combat_Command#update    0.10    57.18      0.06     3224     0.02     0.02  Font#shadow=    0.10    57.24      0.06     3369     0.02     0.02  Window#y    0.10    57.30      0.06    14351     0.00     0.02  BasicObject#!=    0.10    57.36      0.06    11396     0.01     0.01  Window#tone    0.10    57.43      0.06    19130     0.00     0.00  Fixnum#<=>    0.10    57.49      0.06    11258     0.01     0.01  Window#update    0.10    57.55      0.06     3202     0.02     0.03  Window_Selectable#cancel_enabled?    0.10    57.61      0.06     4640     0.01     0.01  Game_CharacterBase#dash?    0.10    57.67      0.06     3680     0.02     0.43  Game_Event#update    0.08    57.72      0.05     2149     0.02     0.03  Game_CharacterBase#frames    0.08    57.77      0.05     4682     0.01     0.02  Rect#y=    0.08    57.81      0.05      367     0.13     0.13  Bitmap#dispose    0.08    57.86      0.05    13109     0.00     0.00  Window#viewport    0.08    57.91      0.05     1449     0.03     0.91  KDEA::UI::Window_Spell_Command#update    0.08    57.96      0.05    15588     0.00     0.00  Kernel#eql?    0.08    58.00      0.05     3862     0.01     0.01  Window_Selectable#handle?    0.08    58.05      0.05     3699     0.01     0.03  Window_Selectable#item_width    0.08    58.10      0.05    11308     0.00     0.00  Sprite_Mouse#enabled?    0.08    58.15      0.05     7294     0.01     0.01  String#sub!    0.08    58.19      0.05     8849     0.01     0.01  Mouse#position    0.08    58.24      0.05     2257     0.02     0.02  Bitmap#disposed?    0.08    58.29      0.05     9018     0.01     0.01  Enumerable#any?    0.08    58.33      0.05    18737     0.00     0.00  Graphics#width    0.08    58.38      0.05    13942     0.00     0.00  Game_Map#loop_vertical?    0.08    58.43      0.05    11396     0.00     0.00  Window#tone=    0.08    58.47      0.05     9421     0.00     0.00  NilClass#nil?    0.08    58.52      0.05     4920     0.01     0.01  Game_CharacterBase#diagonal?    0.08    58.57      0.05     1070     0.04     1.65  Bitmap#draw_text    0.08    58.62      0.05     5636     0.01     0.40  Class#new    0.07    58.66      0.05     4890     0.01     0.01  Sprite#y    0.07    58.71      0.05      883     0.05     0.12  Window_Selectable#ensure_cursor_visible    0.07    58.75      0.05     2832     0.02     0.20  KDEA::UI::Tooltip_Manager#update    0.07    58.80      0.05     9780     0.00     0.01  Sprite_Character#graphic_changed?    0.07    58.85      0.05      701     0.07     0.07  KDEA::StatList#add    0.07    58.89      0.05     3114     0.01     0.01  Bitmap#text_size    0.07    58.94      0.05    11396     0.00     0.00  Game_System#window_tone    0.07    58.98      0.05    13658     0.00     0.00  Window#open?    0.07    59.03      0.05     4890     0.01     0.02  Sprite_Character#setup_new_effect    0.07    59.07      0.04     2119     0.02     0.06  Sprite_Character#update_multi_frames_src_rect    0.05    59.11      0.03       10     3.20   134.00  Window_Base#draw_text_ex    0.05    59.14      0.03     1474     0.02     0.13  Game_Party#all_members    0.05    59.17      0.03     3680     0.01     0.28  Game_Event#update_self_movement    0.05    59.20      0.03     5896     0.01     0.02  Game_Actors#[]    0.05    59.23      0.03     4899     0.01     0.01  Sprite#z=    0.05    59.27      0.03     4313     0.01     0.01  Font#out_color    0.05    59.30      0.03     2118     0.02     0.02  String#gsub    0.05    59.33      0.03     1412     0.02     0.59  TextCache#include?    0.05    59.36      0.03     7725     0.00     0.00  Sprite#src_rect=    0.05    59.39      0.03     7818     0.00     0.00  Fixnum#-@    0.05    59.43      0.03     1449     0.02     0.33  KDEA::UI::Window_Metamagic_Command#update    0.05    59.46      0.03     9946     0.00     0.00  Fixnum#**    0.05    59.49      0.03     3882     0.01     0.01  Game_Map#valid?    0.05    59.52      0.03     1771     0.02     0.34  KDEA::UI::Window_ScrollArrows#update    0.05    59.55      0.03      809     0.04     0.96  Cache#load_bitmap    0.05    59.59      0.03     3040     0.01     0.01  Game_Event#stop_count_threshold    0.05    59.62      0.03      641     0.05     0.05  Game_Message#busy?    0.05    59.65      0.03      480     0.06     0.22  Game_Follower#update    0.05    59.68      0.03     7406     0.00     0.00  Game_CharacterBase#pos?    0.05    59.71      0.03     4800     0.01     0.01  Game_CharacterBase#update_stop    0.05    59.74      0.03      972     0.03     0.33  Window_Selectable#update_cursor    0.05    59.77      0.03     8434     0.00     0.00  Window_Selectable#col_max    0.05    59.80      0.03     8156     0.00     0.00  Regexp#match    0.05    59.83      0.03      705     0.04     0.07  RPG::Skill#is_spell?    0.05    59.87      0.03      161     0.19     0.58  KDEA::UI::Window_StatusEffects#update    0.05    59.90      0.03      480     0.06     1.82  Game_Player#update    0.05    59.93      0.03     4890     0.01     0.01  Game_CharacterBase#screen_z    0.05    59.96      0.03      162     0.19     0.19  Spriteset_Map#update_om_shadow    0.05    59.99      0.03     7725     0.00     0.00  Sprite#src_rect    0.05    60.02      0.03     4800     0.01     0.01  Game_Character#update_stop    0.05    60.05      0.03      687     0.05     0.05  Game_Battler#alive?    0.05    60.08      0.03     9940     0.00     0.00  Fixnum#abs    0.05    60.11      0.03     1958     0.02     0.08  Array#collect    0.05    60.14      0.03      161     0.19     0.29  Window_NumberInput#update    0.05    60.17      0.03     1050     0.03     1.35  String#each_char    0.05    60.20      0.03      161     0.19     0.19  Window_Message#update_back_sprite    0.05    60.23      0.03     7509     0.00     0.00  Window#width    0.05    60.27      0.03     4800     0.01     0.01  Game_CharacterBase#jumping?    0.05    60.29      0.03      320     0.09     0.14  Game_Screen#update    0.05    60.32      0.03     1766     0.02     0.02  Window_Selectable#top_row    0.03    60.34      0.02        6     2.67     2.67  Game_Screen#clear_pictures    0.03    60.36      0.02      138     0.12     0.12  Window_Base#normal_color    0.03    60.37      0.02     1106     0.01     0.01  Kernel#initialize_clone    0.03    60.39      0.02      164     0.10     0.20  Game_BattlerBase#all_features    0.03    60.41      0.02      161     0.10     0.29  KDEA::UI::Window_TextLog#update    0.03    60.42      0.02        6     2.67 20204.67  Scene_Base#main    0.03    60.44      0.02      162     0.10     0.10  Plane#oy=    0.03    60.45      0.02      161     0.10     0.20  KDEA::UI::Window_StatusEffects#process_mouse_handling    0.03    60.47      0.02     8047     0.00     0.00  Sprite#update    0.03    60.49      0.02    10113     0.00     0.00  Array#clear    0.03    60.50      0.02      161     0.10     1.56  KDEA::UI::Window_Portraits#update    0.03    60.52      0.02     1089     0.01     0.04  Enumerable#find    0.03    60.53      0.02     2184     0.01     0.01  Rect#height    0.03    60.55      0.02     2558     0.01     0.01  Window_Command#ok_enabled?    0.03    60.57      0.02     2861     0.01     0.01  Kernel#instance_variables    0.03    60.58      0.02     3089     0.01     0.01  String#split    0.03    60.60      0.02        3     5.33     5.33  DataManager#save_file_exists?    0.03    60.61      0.02       77     0.21     0.42  Window_Base#draw_picture    0.03    60.63      0.02     2138     0.01     0.01  Kernel#kind_of?    0.03    60.65      0.02       68     0.24     4.79  KDEA::UI::Tooltip#initialize    0.03    60.66      0.02     9086     0.00     0.00  IO#read    0.03    60.68      0.02      113     0.14     2.08  TextCache#new_letter    0.03    60.69      0.02      498     0.03     0.35  Game_Party#battle_members    0.03    60.71      0.02      320     0.05     0.10  Game_Interpreter#setup_reserved_common_event    0.03    60.73      0.02     5919     0.00     0.00  Window_Selectable#item_height    0.03    60.74      0.02      320     0.05     0.05  Game_Temp#common_event_reserved?    0.03    60.76      0.02     3411     0.00     0.00  Window_Base#standard_padding    0.03    60.77      0.02     4356     0.00     0.00  Window#contents    0.03    60.79      0.02      126     0.13     0.13  Game_CustItem#initialize    0.03    60.81      0.02      657     0.02     1.26  Bitmap#initialize    0.03    60.82      0.02        1    16.00    16.00  Audio#hzm_Vol_Audio_bgm_play    0.03    60.84      0.02      182     0.09    13.54  Tilemap#new    0.03    60.85      0.02     1449     0.01     0.18  KDEA::UI::Window_Metamagic_Command#process_mouse_handling    0.03    60.87      0.02     6067     0.00     0.00  Window_Command#item_max    0.03    60.89      0.02      644     0.02     0.02  Array#empty?    0.03    60.90      0.02       36     0.44     0.44  Window#height=    0.03    60.92      0.02      161     0.10     0.19  Window_ScrollText#update    0.03    60.93      0.02      165     0.10     0.86  Sprite_Mouse#set_bitmap    0.03    60.95      0.02      961     0.02     0.02  Game_Map#vehicle    0.03    60.97      0.02        1    16.00    16.00  Graphics#snap_to_bitmap    0.03    60.98      0.02      162     0.10     0.10  Viewport#tone=    0.03    61.00      0.02      614     0.03     0.03  Enumerable#max    0.03    61.01      0.02     3680     0.00     0.30  Game_Event#update_stop    0.03    61.03      0.02      489     0.03     0.03  Game_Vehicle#transparent    0.03    61.05      0.02      978     0.02     0.10  Game_Vehicle#screen_y    0.03    61.06      0.02     4488     0.00     0.00  Font#color    0.03    61.08      0.02     2462     0.01     0.01  Font#color=    0.03    61.09      0.02     5373     0.00     0.00  Sprite#visible=    0.03    61.11      0.02     5056     0.00     0.00  Sprite#opacity=    0.03    61.13      0.02      972     0.02     0.02  Window_Selectable#call_update_help    0.03    61.14      0.02      502     0.03     0.03  Game_Party#max_battle_members    0.03    61.16      0.02      844     0.02     0.02  Array#compact    0.03    61.17      0.02       30     0.53     1.07  Object#file_exist?    0.03    61.19      0.02      913     0.02     1.40  Window_Base#process_character    0.03    61.20      0.02     4890     0.00     0.00  Sprite_Character#move_animation    0.03    61.22      0.02       38     0.42     0.84  Game_Battler#add_state    0.03    61.24      0.02      909     0.02     0.05  Window_Base#text_size    0.03    61.25      0.02     7919     0.00     0.00  Game_Map#width    0.03    61.27      0.02      110     0.15     0.15  KDEA::StatList#set    0.03    61.28      0.02     8050     0.00     0.00  Sprite#x=    0.03    61.30      0.02      113     0.14     0.28  TextCache#create_font    0.03    61.32      0.02     8244     0.00     0.00  String#hash    0.03    61.33      0.02        8     2.00     2.00  KDEA::UI::Window_TooltipArrow#arrow_height    0.03    61.35      0.02      160     0.10     0.10  Input#dir8    0.03    61.36      0.02     5665     0.00     0.00  Graphics#frame_rate    0.03    61.38      0.02     2573     0.01     0.01  Window#height    0.02    61.40      0.02      800     0.02     0.04  Input#press?    0.02    61.41      0.02      640     0.02     0.07  Game_Player#dash?    0.02    61.43      0.02      699     0.02     0.02  Kernel#instance_variable_set    0.02    61.44      0.02     5846     0.00     0.00  Time#initialize    0.02    61.46      0.02        3     5.00     5.00  Graphics#freeze    0.02    61.47      0.02      320     0.05    30.67  Game_Map#update    0.02    61.49      0.02     2150     0.01     0.01  String#to_i    0.02    61.50      0.02      949     0.02     1.53  Window_Base#draw_text    0.02    61.52      0.02      909     0.02     1.39  Window_Base#process_normal_character    0.02    61.53      0.02      883     0.02     0.02  Window_Selectable#page_row_max    0.02    61.55      0.02     2876     0.01     0.01  Sprite#disposed?    0.02    61.56      0.02      858     0.02     0.38  Window_Selectable#select    0.02    61.58      0.02      150     0.10     0.10  Window_Base#change_color    0.02    61.59      0.02     1459     0.01     0.01  RPG::AudioFile#initialize    0.02    61.61      0.02     1133     0.01     0.01  Window#cursor_rect=    0.02    61.62      0.02        3     5.00   181.67  Scene_Base#perform_transition    0.02    61.64      0.02      138     0.11     1.82  Window_Base#initialize    0.02    61.65      0.02    10080     0.00     0.00  Game_CharacterBase#moving?    0.02    61.67      0.02     4890     0.00     0.00  Sprite#x    0.02    61.68      0.02     1992     0.01     0.01  Game_BattlerBase#exist?    0.02    61.70      0.02      161     0.09     0.19  KDEA::UI::Window_Hotbar#process_mouse_handling    0.02    61.71      0.02     2100     0.01     0.01  Color#blue    0.02    61.73      0.02       23     0.65     0.65  Game_InventorySlot#can_add_amount?    0.02    61.74      0.02     3300     0.00     0.01  Font#name=    0.02    61.76      0.02     2832     0.01     0.01  Time#<=>    0.02    61.77      0.02      160     0.09     0.49  Scene_Map#update_scene    0.02    61.79      0.02       42     0.36     0.36  Game_Battler#add_feat    0.02    61.80      0.02       63     0.24     0.73  KDEA::UI::Window_Metamagic_Command#draw_item    0.02    61.82      0.02      480     0.03   101.06  Scene_Map#update    0.02    61.83      0.02      162     0.09     0.09  Spriteset_Map#update_timer    0.02    61.85      0.02     1050     0.01     0.01  Font#bold    0.02    61.86      0.02       84     0.18     0.56  Game_BattlerBase#param    0.02    61.88      0.02     7346     0.00     0.00  MatchData#[]    0.02    61.89      0.02      429     0.03     0.03  KDEA::Feat_struct#id=    0.02    61.91      0.01     1036     0.01     0.01  KDEA::Skill_struct#new    0.02    61.92      0.01     2100     0.01     0.01  Color#alpha    0.02    61.94      0.01     3304     0.00     0.03  Font#italic=    0.02    61.95      0.01     8740     0.00     0.00  Window_Selectable#spacing    0.02    61.97      0.01       23     0.65     0.65  Game_InventorySlot#get_stack    0.02    61.98      0.01      328     0.05     0.05  Game_Fogs#each    0.02    62.00      0.01      913     0.02     0.02  String#slice!    0.02    62.01      0.01       69     0.22    14.00  Game_Event#initialize
I know most of the time is inside Hash.each_value, but I'm calling that in like 20 different places. It would be nice to have a breakdown of what % of that time is coming from which exact call, so I can identify which one of those is the problem. As it is, I kinda have to guess. If I had a call tree, I might end up finding 1 of those 20 each_value calls eating 80% of the time, or something like that, e.g.:

 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
Yeah it's a very hacky job tho, I think it'll take too much time to do that right now.  :(
 
Last edited by a moderator:

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,905
Reaction score
451
First Language
April Fools
Primarily Uses
N/A
Need a script error display script like this asap.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,202
First Language
Binary
Primarily Uses
RMMZ
Since the console itself is somehow not so really good for tracking purpose, I modified it so I can check in the external text file
Aww damn, I done that too but never noticed this post till now lol. Aww well, someone had to do it. At least its done :p

Here is my copy of it, not that its much different :p

Code:
   def self.print    set_trace_func nil    total = Process.times[0]    total = 0.01 if total == 0    totals = {}    @@maps.values.each do |threadmap|      threadmap.each do |key,data|        total_data = (totals[key] ||= [0, 0.0, 0.0, key])        total_data[0] += data[0]        total_data[1] += data[1]        total_data[2] += data[2]      end    end    data = totals.values    data = data.sort_by{ |x| -x[2] }    sum = 0    File.open("Profiler.txt","w") do |file|      file << sprintf("     %%   cumulative   self              self     total\n")      file << sprintf("    time   seconds   seconds    calls  ms/call  ms/call  name\n")      for d in data        break if d[2] <= 0.0        sum += d[2]        file << sprintf("%8.2f %8.2f  %8.2f %8d %8.2f %8.2f  %s \n",          d[2]/total*100, sum, d[2], d[0], d[2]*1000/d[0], d[1]*1000/d[0], d[3])        file << ""      end    end    msgbox "Results printed to Profiler.txt. \nTracking reset."  end
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I know most of the time is inside Hash.each_value, but I'm calling that in like 20 different places. It would be nice to have a breakdown of what % of that time is coming from which exact call, so I can identify which one of those is the problem. As it is, I kinda have to guess. If I had a call tree, I might end up finding 1 of those 20 each_value calls eating 80% of the time, or something like that, e.g.:


How do I read that table?
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,202
First Language
Binary
Primarily Uses
RMMZ
Pretty sure its just like a backtracer...

So like PeopleTrax.exe is the program that error'd with each subsequent breakoff being the method that was invoked prior to the error being triggered.

Not sure if that makes sense... :p
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
It shows the execution paths that it took and presumably the screenshot shows how it looks when you drill down a certain path.

So if you call getNames, it does so by reading lines from a some input and trimming the result and doing something with it.

But I don't understand what the numbers mean.

Given what Kaelan is suggesting, I'm under the impression that it might look something like this

Code:
Scene_Battle#update      10   Game_Party.update         5   Game_Troop.update         5
So assuming when the battle scene calls update and it calls two methods, we can see the proportions in some unit of measurement.
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,202
First Language
Binary
Primarily Uses
RMMZ
Yea I'm not sure what the numbers in that example are to show either...

The actual profiler script though, it shows the results in seconds (unless I am mistaken) that each method takes to complete and also how many times its been called and such.

Edit:

Also, wth with the 50+ guests... Someone must have tweeted this post or something ^_^
 
Last edited by a moderator:

flimbo

Villager
Member
Joined
Nov 10, 2013
Messages
23
Reaction score
2
First Language
Portuguese
Primarily Uses
RPG Maker VXAce Profiler

Introduction

Primarily a scripter's tool. It helps you check out the performance of your game and is a lot more accurate than FPS relative values.

This script is made with Neonblack :)

% time 

The percent of the time spent inside the procedure itself (not counting children). 

cumulative seconds 

The total number of seconds spent in the procedure, including children. 

self seconds 

The total number of seconds spent in the procedure itself (not counting children). 

calls 

The total number of times the procedure was called. 

self ms/call 

The average time taken by the procedure itself on each call, in ms. 

total ms/call 

The average time taken by each call to the procedure, including time spent in child functions.
Hi Archeia,

Thanks for this great tool!

My game right now uses several graphic intensive scripts, like Khas Light Effects, Fog, HUD, Weather, etc... and it mostly goes around 60fps, but from time to time it stutters  and looses fps, in situations that I cant figure out what could be causing it (small map, not many events, no parallel processes, etc). So, I wonder if you could give some suggestions on how to interpret the results of the profile, so I could focus on the hidden resource hoggers. For example, should I check the functions that consumes more percentual processing time as a whole or the average time taken on each call would be more relevant?

If graphics.update is skipped it means the game has a major lagspike on normal run. 
Using the profile, the game runs at about 17fps, and the graphics update (like, the character walking around) is reeeeallly slow. This would be considered skipping?

% cumulative self self totaltime seconds seconds calls ms/call ms/call name

6.41 6.00 6.00 103862 0.06 0.09 Array#hash

5.91 11.53 5.53 103532 0.05 0.08 Array#eql?

4.56 15.79 4.27 102964 0.04 1.11 Sprite_Character#update

3.23 18.81 3.02 106690 0.03 0.04 Game_Map#display_x

3.13 21.74 2.93 54255 0.05 0.19 Game_CharacterBase#screen_y

2.96 24.52 2.77 110303 0.03 0.04 Game_Map#display_y

2.55 26.90 2.38 24168 0.10 0.74 Sprite_Character#update_position

2.14 28.90 2.00 16 124.88 175.50 Marshal#load

2.09 30.85 1.95 79622 0.02 0.07 Game_Map#adjust_y

1.97 32.69 1.84 76009 0.02 0.07 Game_Map#adjust_x

1.81 34.39 1.69 18682 0.09 0.27 Game_Event#near_the_screen?

1.55 35.84 1.45 50642 0.03 0.11 Game_CharacterBase#screen_x

1.48 37.22 1.39 1215 1.14 1.14 Graphics#fps_update

1.48 38.61 1.38 418512 0.00 0.00 Float#eql?

1.40 39.91 1.31 419480 0.00 0.00 Float#hash

1.39 41.21 1.30 28037 0.05 1.89 Array#each

1.38 42.50 1.29 23005 0.06 0.18 Game_Event#anti_lag_event_on_screen?

1.28 43.70 1.20 47482 0.03 0.46 Game_CharacterBase#update

1.26 44.88 1.18 24424 0.05 0.05 Bitmap#blt

1.10 45.91 1.03 54255 0.02 0.02 Game_CharacterBase#jump_height

1.08 46.92 1.01 24934 0.04 0.06 Sprite_Base#update

1.06 47.91 0.99 62521 0.02 0.69 Game_Event#update

1.04 48.89 0.98 37364 0.03 0.37 Game_Event#update_self_movement

0.97 49.80 0.91 219629 0.00 0.00 Float#-

0.94 50.68 0.88 217262 0.00 0.00 Fixnum#to_f

0.94 51.55 0.88 43109 0.02 0.03 Comparable#between?

0.88 52.38 0.82 24168 0.03 0.05 Sprite_Character#update_other

0.84 53.16 0.79 218233 0.00 0.00 Float#/

0.83 53.94 0.78 1574 0.49 11.99 String#each_char

0.78 54.67 0.73 262510 0.00 0.00 Kernel#hash

0.74 55.36 0.69 24168 0.03 0.06 Sprite_Character#update_src_rect

0.74 56.05 0.69 17499 0.04 0.65 TextCache#include?

0.73 56.74 0.69 209361 0.00 0.00 Float#*

0.72 57.41 0.67 54255 0.01 0.03 Game_CharacterBase#shift_y

0.72 58.08 0.67 4382 0.15 0.53 Particle_Event#update

0.70 58.73 0.66 15892 0.04 0.06 Game_BaseItem#object

0.68 59.37 0.64 252898 0.00 0.00 IO#getbyte

0.63 59.96 0.59 17499 0.03 1.00 TextCache#letters

0.60 60.52 0.56 5335 0.11 0.49 Light_SSource#draw

0.57 61.05 0.53 25070 0.02 0.03 Sprite_Character#check_can_update_sprite

0.56 61.58 0.53 54450 0.01 0.01 Game_CharacterBase#object_character?

0.55 62.10 0.52 46882 0.01 0.02 BasicObject#!=

0.55 62.61 0.51 209256 0.00 0.00 Kernel#eql?

0.55 63.13 0.51 123907 0.00 0.00 Float#+

0.55 63.64 0.51 25029 0.02 0.21 Game_Event#antilag_force_update?

0.52 64.13 0.48 76897 0.01 0.01 Game_Map#loop_horizontal?

0.48 64.57 0.45 18682 0.02 0.43 Game_Event#update_stop

0.45 65.00 0.43 26694 0.02 0.03 Game_CharacterBase#real_move_speed

0.45 65.42 0.42 228 1.85 1.92 Bitmap#initialize

0.45 65.84 0.42 24168 0.02 0.04 Sprite_Character#graphic_changed?

0.43 66.25 0.40 40625 0.01 0.01 Fixnum#==

0.43 66.65 0.40 36206 0.01 0.02 Game_Event#character_index

0.43 67.05 0.40 145431 0.00 0.00 Integer#floor

0.41 67.44 0.39 22813 0.02 0.02 Game_Character#update_stop

0.41 67.83 0.39 153136 0.00 0.00 Fixnum#-

0.38 68.19 0.36 24168 0.01 0.02 Sprite_Character#zoom_update

0.38 68.54 0.36 80045 0.00 0.00 Game_Map#loop_vertical?

0.37 68.89 0.34 105194 0.00 0.00 String#hash

0.35 69.22 0.33 24492 0.01 0.02 Rect#set

0.35 69.54 0.33 24168 0.01 0.06 Sprite_Character#update_bitmap

0.33 69.86 0.31 1574 0.20 0.30 Font#to_a

0.33 70.17 0.31 24168 0.01 0.02 Sprite_Character#rotate_update

0.32 70.47 0.30 24168 0.01 0.02 Sprite_Character#setup_new_effect

0.31 70.76 0.29 51040 0.01 0.01 Sprite#visible

0.30 71.04 0.28 2592 0.11 0.39 Game_Character#process_move_command

0.30 71.32 0.28 24168 0.01 0.01 Sprite_Character#blend_update

0.29 71.59 0.27 23741 0.01 0.02 Game_CharacterBase#update_anime_count

0.28 71.85 0.26 1558 0.17 1.28 Game_BattlerBase#param

0.28 72.12 0.26 18682 0.01 0.02 Switch#stop_npc_movement

0.27 72.37 0.25 24180 0.01 0.01 Sprite_Character#update_balloon

0.27 72.62 0.25 50834 0.00 0.01 Game_CharacterBase#moving?

0.27 72.87 0.25 23741 0.01 0.05 Game_CharacterBase#update_animation

0.25 73.10 0.24 5335 0.04 0.13 Light_SSource#sy

0.25 73.34 0.24 24934 0.01 0.01 Sprite_Base#update_animation

0.25 73.57 0.24 24168 0.01 0.01 Sprite_Character#mirror_update

0.25 73.81 0.24 52043 0.00 0.00 String#[]

0.25 74.04 0.23 86720 0.00 0.00 Fixnum#<=>

0.25 74.27 0.23 56969 0.00 0.00 Sprite#visible=

0.25 74.50 0.23 7660 0.03 0.04 Window_Base#update

0.23 74.72 0.22 49879 0.00 0.00 Array#clear

0.23 74.94 0.22 1442 0.15 13.85 GameTime::Window_GameClock#update

0.23 75.15 0.22 18784 0.01 0.01 Game_Event#character_name

0.22 75.36 0.20 37289 0.01 0.01 Sprite#x=

0.22 75.56 0.20 778 0.26 20.57 Hash#each_value

0.22 75.77 0.20 43295 0.00 0.00 BasicObject#==

0.22 75.97 0.20 59159 0.00 0.00 Array#empty?

0.21 76.17 0.20 2250 0.09 0.14 Particles_Title#update

0.20 76.36 0.19 6144 0.03 49.68 Spriteset_Map#update

0.20 76.54 0.19 2430 0.08 1.74 Graphics#update

0.20 76.73 0.19 55183 0.00 0.00 Fixnum#**

0.20 76.92 0.19 53477 0.00 0.00 String#eql?

0.18 77.09 0.17 35032 0.00 0.00 Bitmap#rect

0.18 77.26 0.17 30953 0.01 0.01 Fixnum#===

0.18 77.43 0.17 22813 0.01 0.01 Game_CharacterBase#update_stop

0.18 77.60 0.17 28550 0.01 0.01 Game_CharacterBase#screen_z

0.18 77.77 0.17 17304 0.01 0.01 Game_Event#stop_count_threshold

0.18 77.94 0.17 38055 0.00 0.00 Sprite#y=

0.18 78.11 0.17 43477 0.00 0.00 Fixnum#-@

0.17 78.27 0.16 5388 0.03 0.20 Game_Vehicle#screen_y

0.17 78.43 0.16 1574 0.10 12.44 Bitmap#draw_text_cached

0.17 78.58 0.16 1 156.00 156.00 Graphics#fadeout

0.17 78.74 0.16 72073 0.00 0.00 Float#floor

0.17 78.89 0.16 49102 0.00 0.00 Sprite_Base#animation?

0.16 79.05 0.15 35646 0.00 0.00 Float#<=

0.15 79.19 0.14 33474 0.00 0.00 Sprite#z=

0.15 79.33 0.14 23743 0.01 0.01 Game_CharacterBase#jumping?

0.15 79.47 0.14 769 0.18 4.38 Ultima_Hud#update

0.15 79.61 0.14 62202 0.00 0.00 Proc#call

0.15 79.75 0.14 5335 0.03 0.54 Game_Event#draw_light

0.15 79.89 0.14 24936 0.01 0.01 Sprite#src_rect=

0.13 80.02 0.13 1574 0.08 12.73 Bitmap#draw_text

0.13 80.14 0.13 768 0.16 0.36 Game_Map_Effects#active?

0.13 80.27 0.13 6152 0.02 0.02 Ultima_Hud#fade_sprite

0.13 80.39 0.13 23880 0.01 0.01 Game_Switches#[]

0.13 80.52 0.13 24168 0.01 0.01 Sprite_Character#update_maha_sprite

0.13 80.64 0.12 39167 0.00 0.00 Sprite#opacity=

0.13 80.77 0.12 5335 0.02 0.51 Game_Character#draw_light

0.13 80.89 0.12 24168 0.01 0.01 Sprite#bush_depth=

0.13 81.01 0.12 32691 0.00 0.00 Sprite#update

0.13 81.14 0.12 55611 0.00 0.00 Fixnum#abs

0.13 81.26 0.12 768 0.16 4.13 Spriteset_Map#update_lights

0.13 81.39 0.12 1350 0.09 2.87 Scene_Map#update_scene

0.13 81.51 0.12 2025 0.06 2.81 Game_Player#update

0.13 81.63 0.12 15892 0.01 0.07 Game_EquipSlot#object

0.13 81.76 0.12 20909 0.01 0.01 Rect#width

0.13 81.88 0.12 52345 0.00 0.00 Numeric#eql?

0.12 81.99 0.11 768 0.14 0.54 Spriteset_Map#update_parallax

0.12 82.10 0.11 4614 0.02 0.09 CT_Sprite_Timer#update

0.12 82.21 0.11 46010 0.00 0.00 Float#truncate

0.12 82.32 0.11 23754 0.00 0.00 Game_CharacterBase#dash?

0.12 82.43 0.11 6817 0.02 0.04 Enumerable#max

0.12 82.54 0.11 15887 0.01 0.01 Game_BaseItem#is_armor?

0.12 82.64 0.11 2927 0.04 1.87 Integer#times

0.12 82.75 0.11 34625 0.00 0.00 Sprite#y

0.12 82.86 0.11 179 0.60 2.08 Range#each

0.11 82.97 0.11 24189 0.00 0.00 Sprite#zoom_x=

0.10 83.06 0.10 24168 0.00 0.00 Sprite_Character#move_animation

0.10 83.16 0.10 21089 0.00 0.00 Graphics#height

0.10 83.25 0.10 2940 0.03 0.07 Game_Player#dash?

0.10 83.35 0.09 10096 0.01 0.21 Class#new

0.10 83.44 0.09 3204 0.03 0.03 CT_Sprite_Timer#update_visibility

0.10 83.54 0.09 3800 0.02 0.17 Game_Interpreter#update

0.10 83.63 0.09 37792 0.00 0.00 Float#>=

0.10 83.72 0.09 3316 0.03 0.03 Bitmap#text_size

0.10 83.82 0.09 3375 0.03 330.02 Scene_Map#update

0.10 83.91 0.09 4050 0.02 0.02 CT_Game_Timer#update

0.10 84.00 0.09 1530 0.06 0.24 Game_Screen#update

0.10 84.10 0.09 900 0.10 0.24 Bitmap#font=

0.10 84.19 0.09 9263 0.01 0.15 Array#collect

0.10 84.28 0.09 30236 0.00 0.00 Sprite#x

0.10 84.37 0.09 15892 0.01 0.01 Game_BaseItem#is_item?

0.08 84.45 0.08 21106 0.00 0.00 Float#==

0.08 84.53 0.08 4414 0.02 0.03 Game_Player#vehicle

0.08 84.61 0.08 26422 0.00 0.00 Sprite#angle=

0.08 84.69 0.08 2298 0.03 0.94 Window_Message#update_all_windows

0.08 84.77 0.08 5335 0.01 0.08 Light_SSource#sx

0.08 84.85 0.08 6076 0.01 0.02 Scene_Base#scene_changing?

0.08 84.93 0.08 1627 0.05 0.40 Game_Actor#feature_objects

0.08 85.00 0.08 1421 0.06 0.12 GameTime::Window_GameClock#dated_military_clock

0.08 85.08 0.08 24171 0.00 0.00 Sprite#mirror=

0.08 85.16 0.08 1574 0.05 0.13 Bitmap#check_squeeze_allowed

0.08 85.24 0.08 3942 0.02 0.04 Game_Message#busy?

0.08 85.32 0.08 24307 0.00 0.00 Sprite#blend_type=

0.08 85.39 0.08 1558 0.05 0.06 Game_Actor#param_base

0.08 85.47 0.08 4523 0.02 0.02 Bitmap#clear

0.08 85.55 0.08 17790 0.00 0.00 RPG::CommonEvent#autorun?

0.08 85.63 0.08 48482 0.00 0.00 Kernel#is_a?

0.08 85.70 0.08 24936 0.00 0.00 Sprite#src_rect

0.08 85.78 0.08 18046 0.00 0.00 Sprite#opacity

0.08 85.86 0.08 1356 0.06 0.06 GameTime::Sprite_TimeTint#no_tint

0.08 85.93 0.08 7680 0.01 0.01 Window_Base#update_tone

0.08 86.01 0.08 18813 0.00 0.00 Game_Event#check_event_trigger_auto

0.07 86.07 0.06 768 0.08 0.20 Game_Map#parallax_ox

0.07 86.14 0.06 3259 0.02 0.07 Array#select

0.07 86.20 0.06 769 0.08 0.12 Ultima_Hud#update_equipment

0.07 86.26 0.06 15892 0.00 0.00 Game_BaseItem#is_weapon?

0.07 86.32 0.06 1350 0.05 2.39 Scene_Map#update_transfer_player

0.07 86.39 0.06 10569 0.01 0.01 SceneManager#scene

0.07 86.45 0.06 768 0.08 0.39 Spriteset_Map#update_shadow

0.07 86.51 0.06 27590 0.00 0.00 Graphics#width

0.07 86.58 0.06 1558 0.04 0.05 Game_BattlerBase#param_buff_rate

0.07 86.64 0.06 854 0.07 0.35 Plane_Fog#update

0.07 86.70 0.06 6128 0.01 0.01 Window_Selectable#handle?

0.07 86.76 0.06 2286 0.03 0.51 Cache#load_bitmap

0.07 86.83 0.06 19681 0.00 0.00 Bitmap#disposed?

0.07 86.89 0.06 1992 0.03 0.03 Game_Map#tile_id

0.07 86.95 0.06 4414 0.01 0.01 Game_Map#vehicle

0.07 87.01 0.06 769 0.08 1.39 Ultima_Hud#update_flow_mp

0.07 87.07 0.06 676 0.09 0.16 GameTime::Current_Time#update

0.07 87.13 0.06 1627 0.04 0.46 Game_BattlerBase#all_features

0.06 87.19 0.06 768 0.08 0.10 Spriteset_Map#update_viewport_weather

0.05 87.24 0.05 1539 0.03 0.05 Game_Pictures#each

0.05 87.29 0.05 1356 0.04 0.06 Game_BattlerBase#death_state?

0.05 87.34 0.05 1428 0.03 0.03 Game_BattlerBase#exist?

0.05 87.38 0.05 1350 0.04 0.20 Game_Unit#alive_members

0.05 87.43 0.05 1558 0.03 0.44 Game_Actor#param_plus

0.05 87.48 0.05 6805 0.01 0.01 Fixnum#to_s

0.05 87.53 0.05 1532 0.03 0.03 Window_Selectable#cursor_movable?

0.05 87.57 0.05 3060 0.02 39.98 Game_Map#update

0.05 87.62 0.05 1111 0.04 0.45 Cache#normal_bitmap

0.05 87.67 0.05 8148 0.01 0.01 Float#>

0.05 87.72 0.05 3942 0.01 0.01 Game_Message#num_input?

0.05 87.76 0.05 39 1.21 1.21 Audio#bgm_play

0.05 87.81 0.05 1532 0.03 0.18 Window_Selectable#update

0.05 87.86 0.05 1361 0.03 1.70 Kernel#loop

0.05 87.90 0.05 854 0.06 0.24 Plane_Fog#update_bitmap

0.05 87.95 0.05 1628 0.03 0.05 Kernel#clone

0.05 88.00 0.05 781 0.06 0.06 Game_Map#first_tag

0.05 88.04 0.05 3 15.67 15.67 Graphics#transition

0.05 88.09 0.05 1230 0.04 0.05 Game_Event#conditions_met?

0.05 88.14 0.05 1558 0.03 0.51 Game_BattlerBase#features_pi

0.05 88.19 0.05 868 0.05 0.05 Bitmap#fill_rect

0.05 88.23 0.05 2310 0.02 0.03 Game_Vehicle#transparent

0.05 88.28 0.05 1350 0.03 0.03 Scene_Map#update_call_debug

0.05 88.33 0.05 9536 0.00 0.00 Kernel#nil?

0.05 88.37 0.05 2202 0.02 0.02 Fiber#yield

0.05 88.42 0.05 900 0.05 0.05 Sprite_Character#balloon_frame_index

0.05 88.47 0.05 766 0.06 0.06 Spriteset_ATS_Face#update_fade

0.05 88.51 0.05 1253 0.04 0.04 Game_Map#valid?

0.05 88.56 0.05 3212 0.01 0.02 CT_Game_Timer#sec

0.05 88.60 0.05 1536 0.03 0.03 Viewport#tone=

0.05 88.65 0.05 2625 0.02 0.02 Array#==

0.05 88.70 0.05 6371 0.01 0.01 Font#color

0.05 88.74 0.05 5314 0.01 0.11 Game_Event#move_type_custom

0.05 88.79 0.05 5316 0.01 0.10 Game_Character#update_routine_move

0.05 88.83 0.05 3942 0.01 0.01 Game_Message#has_text?

0.05 88.88 0.05 2183 0.02 0.06 Game_Party#members

0.05 88.92 0.05 2255 0.02 0.05 Game_Party#all_members

0.05 88.97 0.05 24168 0.00 0.00 Sprite#color=

0.03 89.00 0.03 596 0.05 0.68 Game_Map#setup_starting_event

0.03 89.03 0.03 12057 0.00 0.00 Sprite#bitmap

0.03 89.06 0.03 1114 0.03 0.04 Cache#include?

0.03 89.10 0.03 2475 0.01 0.01 MatchData#[]

0.03 89.13 0.03 1350 0.02 0.03 Scene_Map#update_call_menu

0.03 89.16 0.03 928 0.03 0.05 Game_CharacterBase#distance_per_frame

0.03 89.19 0.03 768 0.04 0.18 Spriteset_Map#update_tilemap

0.03 89.22 0.03 1350 0.02 0.24 Scene_Base#check_gameover

0.03 89.26 0.03 819 0.04 0.36 Kernel#eval

0.03 89.29 0.03 675 0.05 0.23 Climate_Control#update

0.03 89.32 0.03 8939 0.00 0.00 Fixnum#+

0.03 89.35 0.03 769 0.04 0.04 Light_Surface#color

0.03 89.38 0.03 766 0.04 0.04 Spriteset_ATS_Face#blinking?

0.03 89.42 0.03 222 0.14 0.14 Scene_Title#update_logo

0.03 89.45 0.03 2304 0.01 0.01 Spriteset_Weather#dimness

0.03 89.48 0.03 4642 0.01 0.01 Game_Map#map_id

0.03 89.51 0.03 765 0.04 0.17 Game_Screen#update_fogs

0.03 89.54 0.03 3190 0.01 0.01 Color#red

0.03 89.58 0.03 210 0.15 0.30 Game_Map#set_display_x

0.03 89.61 0.03 768 0.04 0.31 Spriteset_Map#update_weather

0.03 89.64 0.03 675 0.05 0.42 Game_Player#update_scroll

0.03 89.67 0.03 1539 0.02 0.29 Game_Fogs#each

0.03 89.70 0.03 769 0.04 0.12 Sprite_Timer#update

0.03 89.74 0.03 676 0.05 0.55 GameTime#update

0.03 89.77 0.03 7684 0.00 0.00 Rect#initialize

0.03 89.80 0.03 3 10.33 10.33 Audio#bgs_play

0.03 89.83 0.03 1215 0.03 0.04 Comparable#==

0.03 89.86 0.03 769 0.04 1.50 Ultima_Hud#update_hp

0.03 89.89 0.03 3189 0.01 0.01 Game_BattlerBase#states

0.03 89.92 0.03 593 0.05 0.52 Game_Map#setup_autorun_common_event

0.03 89.95 0.03 1611 0.02 0.24 Enumerable#find

0.03 89.99 0.03 676 0.05 0.16 Scene_Base#update_interpreter

0.03 90.02 0.03 2548 0.01 0.10 Fiber#resume

0.03 90.05 0.03 1238 0.03 0.08 Climate_Control#climate?

0.03 90.08 0.03 768 0.04 0.08 Spriteset_Weather#update_screen

0.03 90.11 0.03 1214 0.03 0.03 Input#update

0.03 90.14 0.03 768 0.04 0.08 Spriteset_Weather#power=

0.03 90.17 0.03 1287 0.02 0.02 Float#<

0.03 90.20 0.03 2 15.50 15.50 Audio#se_play

0.03 90.23 0.03 3064 0.01 0.04 Window_Selectable#process_handling

0.03 90.26 0.03 1350 0.02 0.22 Game_Party#all_dead?

0.03 90.30 0.03 450 0.07 0.38 Game_Player#update_nonmoving

0.03 90.33 0.03 1558 0.02 0.53 Game_BattlerBase#param_rate

0.03 90.36 0.03 75 0.41 0.41 Array#delete

0.03 90.39 0.03 766 0.04 0.31 Spriteset_ATS_Face#update

0.03 90.42 0.03 10491 0.00 0.00 Input#trigger?

0.03 90.45 0.03 851 0.04 0.09 Game_Fog#update_move

0.03 90.48 0.03 350 0.09 0.09 Game_Interpreter#wait_for_message

0.03 90.51 0.03 1421 0.02 0.02 GameTime::Window_GameClock#blinky

0.03 90.54 0.03 769 0.04 1.46 Ultima_Hud#update_flow_hp

0.03 90.57 0.03 3768 0.01 0.01 Game_Variables#[]

0.03 90.61 0.03 4782 0.01 0.02 Enumerable#inject

0.03 90.64 0.03 4740 0.01 0.01 Graphics#frame_count

0.03 90.67 0.03 957 0.03 0.03 Kernel#respond_to?

0.03 90.70 0.03 766 0.04 0.12 Window_NumberInput#update_cursor

0.03 90.73 0.03 1708 0.02 0.02 Game_CharacterBase#pos_nt?

0.03 90.76 0.03 766 0.04 1.34 Window_Message#update

0.03 90.79 0.03 3225 0.01 0.36 Game_Actor#equips

0.03 90.82 0.03 1272 0.02 0.02 Game_Interpreter#setup_reserved_common_event

0.03 90.85 0.03 3775 0.01 0.01 Kernel#block_given?

0.03 90.88 0.03 765 0.04 0.06 Game_Vehicle#update_airship_altitude

0.03 90.91 0.03 6986 0.00 0.00 Fixnum#>

0.03 90.94 0.03 3958 0.01 0.01 Color#alpha

0.03 90.97 0.03 4834 0.01 0.01 Fixnum#*

0.03 91.00 0.03 3844 0.01 0.01 Window#active

0.02 91.01 0.02 766 0.02 0.04 Window_Gab#show_window?

0.02 91.03 0.02 72 0.22 0.43 Game_Player#map_passable?

0.02 91.04 0.02 58 0.28 0.53 Game_Map#ladder?

0.02 91.06 0.02 1574 0.01 0.01 Font#shadow

0.02 91.08 0.02 140 0.11 0.22 Game_Interpreter#command_230

0.02 91.09 0.02 675 0.02 0.05 Game_Player#update_vehicle

0.02 91.11 0.02 765 0.02 20.96 Game_Map#update_events

0.02 91.12 0.02 765 0.02 0.02 Game_Vehicle#max_altitude

0.02 91.14 0.02 2025 0.01 0.38 Game_Follower#update

0.02 91.16 0.02 636 0.03 0.03 Game_Character#process_route_end

0.02 91.17 0.02 1844 0.01 0.01 Array#[]

0.02 91.19 0.02 1221 0.01 0.01 Rect#y=

0.02 91.20 0.02 411 0.04 0.04 Game_CharacterBase#tile?

0.02 91.22 0.02 818 0.02 0.02 Game_Map#data

0.02 91.24 0.02 3304 0.00 0.00 Bitmap#width

0.02 91.25 0.02 1352 0.01 0.01 Game_Player#transfer?

0.02 91.27 0.02 1538 0.01 0.37 Ultima_Hud#smart_fade_in_range?

0.02 91.28 0.02 1350 0.01 0.01 Game_Player#encounter

0.02 91.30 0.02 768 0.02 0.08 Module_Weather_EX#update_weather_ex

0.02 91.32 0.02 953 0.02 0.02 Fixnum#<

0.02 91.33 0.02 210 0.08 0.08 Game_Map#limit_x

0.02 91.35 0.02 769 0.02 0.02 Sprite_Timer#update_visibility

0.02 91.36 0.02 766 0.02 0.24 Window_NumberInput#update

0.02 91.38 0.02 769 0.02 0.06 Ultima_Hud#update_face

0.02 91.40 0.02 768 0.02 0.06 Spriteset_Map#update_pictures

0.02 91.41 0.02 798 0.02 0.02 Integer#to_i

0.02 91.43 0.02 1365 0.01 0.01 Game_BattlerBase#death_state_id

0.02 91.44 0.02 769 0.02 0.02 Ultima_Hud#can_auto_hide?

0.02 91.46 0.02 769 0.02 0.04 Sprite_Timer#update_bitmap

0.02 91.48 0.02 678 0.02 0.16 GameTime::Sprite_TimeTint#use_khas

0.02 91.49 0.02 769 0.02 0.14 Ultima_Hud#update_states

0.02 91.51 0.02 1536 0.01 0.01 Spriteset_Weather#sprite_max

0.02 91.52 0.02 3064 0.01 0.06 Window_Selectable#process_cursor_move

0.02 91.54 0.02 769 0.02 0.80 Ultima_Hud#update_visible

0.02 91.56 0.02 20 0.80 0.80 Block_WL#initialize

0.02 91.57 0.02 1627 0.01 0.01 Game_BattlerBase#feature_objects

0.02 91.59 0.02 1215 0.01 0.01 Time#<=>

0.02 91.60 0.02 52 0.31 1.81 Sprite_Character#initialize

0.02 91.62 0.02 122 0.13 0.13 TextCache#canvas

0.02 91.64 0.02 1287 0.01 0.02 Font#name=

0.02 91.65 0.02 3202 0.00 0.00 Game_Actor#class

0.02 91.67 0.02 1290 0.01 0.01 Font#size=

0.02 91.68 0.02 769 0.02 0.02 Ultima_Hud#update_gold

0.02 91.70 0.02 495 0.03 0.03 String#to_sym

0.02 91.72 0.02 18 0.89 0.89 Light_SSource#x

0.02 91.73 0.02 3 5.33 10.67 Climate_Control#auto_change_weather

0.02 91.75 0.02 569 0.03 0.03 Block_SD#shadow_ix

0.02 91.76 0.02 1947 0.01 0.01 Fixnum#&

0.02 91.78 0.02 1558 0.01 0.01 Game_BattlerBase#param_plus

0.02 91.80 0.02 824 0.02 0.95 Game_Event#refresh

0.02 91.81 0.02 8347 0.00 0.00 IO#read

0.02 91.83 0.02 2345 0.01 0.01 Table#_load

0.02 91.84 0.02 46 0.35 3.39 Game_Event#macgve_setup_composite_characters

0.02 91.86 0.02 20 0.80 0.80 Window#windowskin=

0.02 91.88 0.02 412 0.04 0.04 Game_PageInterpreter#setup

0.02 91.89 0.02 55 0.29 0.85 Sprite_Character#set_character_bitmap

0.02 91.91 0.02 1574 0.01 0.01 Font#outline

0.02 91.92 0.02 769 0.02 0.02 Ultima_Hud#update_tp

0.02 91.94 0.02 678 0.02 0.25 GameTime#update_tint

0.02 91.96 0.02 1532 0.01 0.01 Window#open?

0.02 91.97 0.02 1679 0.01 0.01 Color#set

0.02 91.99 0.02 769 0.02 0.02 Ultima_Hud#execute_mp_damage_flow

0.02 92.00 0.02 1678 0.01 0.01 Plane#ox=

0.02 92.02 0.02 3204 0.00 0.01 CT_Sprite_Timer#update_position

0.02 92.04 0.02 676 0.02 0.05 GameTime#no_time_map

0.02 92.05 0.02 2624 0.01 0.01 Game_Map#tileset

0.02 92.07 0.02 1598 0.01 0.01 String#initialize_copy

0.02 92.08 0.02 769 0.02 0.47 Ultima_Hud#update_equip_smart_fade

0.02 92.10 0.02 2430 0.01 0.01 Time#now

0.02 92.12 0.02 2602 0.01 0.01 Kernel#rand

0.02 92.13 0.02 5335 0.00 0.00 Light_SSource#opacity

0.02 92.15 0.02 769 0.02 0.02 Ultima_Hud#update_name

0.02 92.16 0.02 6413 0.00 0.00 Graphics#frame_rate

0.02 92.18 0.02 766 0.02 0.04 Window_ATS_Name#update

0.02 92.20 0.02 1628 0.01 0.02 Kernel#initialize_clone

0.02 92.21 0.02 42 0.38 1.52 Game_Map#events_xy

0.02 92.23 0.02 854 0.02 0.02 Plane_Fog#update_move

0.02 92.24 0.02 48 0.31 0.65 Cache#macgve_tidy_cg_array

0.02 92.26 0.02 768 0.02 0.02 Tilemap#ox=

0.02 92.27 0.02 72 0.21 0.65 Game_Party#battle_members

0.02 92.29 0.02 14839 0.00 0.00 Array#[]=

0.02 92.30 0.02 3 5.00 5.00 Game_Event#unlock

0.02 92.32 0.02 215 0.07 0.07 Block_IL#shadow_iy

0.02 92.33 0.02 1356 0.01 0.09 Game_BattlerBase#alive?

0.02 92.35 0.02 1027 0.01 0.10 Game_Player#movable?

0.02 92.36 0.02 900 0.02 0.02 Sprite#z

0.02 92.38 0.02 769 0.02 0.02 Sprite_Timer#update_position

0.02 92.39 0.02 138 0.11 1.12 Spriteset_Map#add_effect

0.02 92.41 0.02 569 0.03 0.03 Block_SD#shadow_fx

0.02 92.42 0.02 766 0.02 0.06 Window_Message#update_back_sprite

0.02 92.44 0.02 2304 0.01 0.01 Viewport#update

0.02 92.45 0.02 242 0.06 0.19 MA_SoundEmitter#calc_volume

0.02 92.47 0.02 1536 0.01 0.17 Spriteset_Map#update_viewports

0.02 92.48 0.02 4336 0.00 0.00 Input#press?

0.02 92.50 0.02 854 0.02 0.02 Plane#tone=

0.02 92.51 0.02 2703 0.01 17.35 Scene_Base#update

0.02 92.53 0.02 1558 0.01 0.46 Game_BattlerBase#features_with_id

0.02 92.54 0.02 766 0.02 0.04 Window_NumberInput#process_cursor_move

0.02 92.56 0.02 2282 0.01 0.01 Game_Map#width

0.02 92.57 0.02 1574 0.01 0.01 Font#bold

0.02 92.59 0.02 6215 0.00 0.00 Table#[]

0.02 92.60 0.02 88 0.17 0.17 Window#height

0.02 92.62 0.02 3771 0.00 0.00 String#empty?

0.02 92.63 0.02 928 0.02 0.17 Game_CharacterBase#update_move

0.02 92.65 0.02 4415 0.00 0.00 String#to_s

0.02 92.66 0.02 24189 0.00 0.00 Sprite#zoom_y=

0.02 92.68 0.02 2295 0.01 0.15 Game_Vehicle#update

0.02 92.69 0.02 1304 0.01 0.01 String#to_i

0.02 92.71 0.02 678 0.02 0.23 GameTime::Sprite_TimeTint#update

0.02 92.72 0.02 768 0.02 0.02 Tone#gray

0.02 92.74 0.02 6128 0.00 0.00 Hash#include?

0.02 92.75 0.02 15892 0.00 0.00 Game_BaseItem#is_skill?

0.02 92.77 0.02 210 0.07 0.07 Game_Player#center_x

0.02 92.78 0.02 61 0.25 2.28 Game_CharacterBase#move_straight

0.02 92.80 0.02 675 0.02 1.20 Game_Followers#update

0.02 92.81 0.02 766 0.02 15.19 Scene_Base#update_all_windows

0.02 92.83 0.02 694 0.02 0.36 Game_Interpreter#run

0.02 92.84 0.02 768 0.02 0.38 Spriteset_Map_Effects#update

0.02 92.86 0.02 768 0.02 0.06 Module_Weather_EX#refresh_weather_ex

0.02 92.87 0.01 2250 0.01 0.02 Particles_Title#can_reset_setting?

0.02 92.89 0.01 3204 0.00 0.04 CT_Sprite_Timer#update_bitmap

0.02 92.90 0.01 61 0.25 2.28 TextCache#new_letter

0.02 92.92 0.01 1 15.00 15.00 Graphics#wait

0.02 92.93 0.01 19 0.79 0.79 Cache#macgve_src_rect

0.02 92.95 0.01 768 0.02 4.41 Spriteset_Map#update_ultima_hud

0.02 92.96 0.01 675 0.02 0.90 Game_Map#update_interpreter

0.02 92.98 0.01 975 0.02 0.02 Font#color=

0.02 92.99 0.01 1959 0.01 0.01 Array#include?
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,202
First Language
Binary
Primarily Uses
RMMZ
@flimbo

Using the profile, the game runs at about 17fps, and the graphics update (like, the character walking around) is reeeeallly slow. This would be considered skipping?
Not quite. Skipping would happen without the profiler script. The profiler dramatically slows things down in order to test the times everything takes to process. It wouldnt be a script that was included in a final game project for example.

Skipping would be noticeable if like, your characters randomly hopped around the map wth a considerable (momentary) FPS drop each time :)
 
Last edited by a moderator:

SweetMeltyLove

Veteran
Veteran
Joined
May 4, 2015
Messages
113
Reaction score
155
First Language
English
Primarily Uses
RMVXA
Wow this script is amazing! I was wishing the heavens for something like this

But I'm not too sure how to read the information I'm getting, I would appreciate if someone could give me a hand :kaoswt:

I'm getting some lag during battles in my game, it fluctuates between 57~59 fps (it never reaches 60) but if I delete everything other than the bulk of the battle system, I get pretty consistent 60 fps. I've been trying to pinpoint the script causing this but I haven't been finding success.

So I've let the profiler running during the battle scene for my game for 1 minute, and also let it run on the stripped down version for 1 minute so I have the two to compare and find the culprit

But looking at both I can't tell what's going on :kaodes:

The one thing that jumped out to me is that in the full version, there's "Integer#times" spending a lot of ms/call while only doing very few calls, but if I understand this correctly, "Integer#times" is just simple number multiplication. Why would that be causing lag and how would I even track which script is doing that?

This is the complete version profile (the laggy one):
https://drive.google.com/open?id=1QD6DoXTe2mQLjQiE2jfZxyS6trMVpWGW

And this is the stripped down version (the not laggy one):
https://drive.google.com/open?id=1-lqfWpVeyUeZ-48NhgM59y2UfzyY7Pgd
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top