Sprite Encoding/Cache/Palette Check performance is poor due to generic.find_file
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- compilers, performance, tooling
Research direction
Start at generic.find_file, which nmlc calls before reading sprite PNG files, and trace how it normalizes case and checks duplicate or name collisions. Use procmon with a large GRF to compare directory enumeration before and after the change; done means avoiding the unnecessary enumeration while preserving the intended case-sensitive file behavior.
Written by the indexing model from the issue text.
Description
Pointing procmon at nmlc on windows reveals that before every actual read of a sprite png file, there's a full enumeration of the directory that sprite contains as nmlc attempts to normalise file case and check for potential duplicates/name collisions.
Obviously on windows this is really a nonsense, but it does impact performance in grfs that have a large number of input files in a directory. In my tests (boring hardware, large grf) 75% of the process time was apparently spent under find_file.
I think the obvious answer here is to simplify find_file to not handle case conversion at all (demand authors write better nml). Everything else is case sensitive.
- Dominant language
- Python
- Stars
- 61
- Forks
- 47
- Avg merge
- 8d 14h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenTTD/nml
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Bug(?): Re-definition of alternative sprites is not treated as an error but has no productive useOpen
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
component/fhir type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OpenConceptLab/ocl_issues#3026 ·
-
ODS datetime imports reject fractional seconds and exports drop themPossibly taken @IlyaKhalafi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
TauricResearch/TradingAgents#1693 ·
Maintainers usually reply within 2 days
-
requests support
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
UKGovernmentBEIS/inspect_ai#6537 ·
Maintainers usually reply within 1 day