Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature: NewGRF callback profiling #7868
Adds a console command
I'm not entirely sure if this is useful or not, hopefully someone can try it out and decide. It should have almost no impact on performance when not in use. The console command requires developer tools to be enabled.
Careful, the CSV files can get very large very fast :) One small-ish test game with (a beta of) Iron Horse being profiled made a CSV file of 8 MB with more than 460k events recorded across 7 in-game days.
Just extra info...
Filesize: 30 days of Horse profiling (in a small game) gives 3m line csv. Some Excel versions, Apple Numbers etc won't open large files (the limit is sometimes 65k). Libre Office, some Excel versions might do more. I'm thinking that grf authors will find it better to write a python script to summarise the data, or maybe a jupyter notebook or similar.
Adds a console command newgrf_profile to collect some profiling data about NewGRF action 2 callbacks and produce a CSV file.
I think most NML GRFs will have automatically assigned item id's, but it really ought to be the value you can use to figure out which specific engine, industry tile, or whatever, that's causing the activity.