Skip to content

Glyphmap, glyphs: performance optimizations - #1626

Open
ingpaschke wants to merge 3 commits into
NetHack:m68k-wipfrom
ingpaschke:glyphmap-rebuild-opt
Open

ingpaschke wants to merge 3 commits into
NetHack:m68k-wipfrom
ingpaschke:glyphmap-rebuild-opt

Conversation

@ingpaschke

Copy link
Copy Markdown
Contributor

These changes address performance problems with glyphmap building and glyphmap population:

glyphs.c

  • glyphs: build the sorted hash index lazily only on the first lookup that needs it (all m68k ports currently don't do G_ lookups in their default configuration, if a user config does, it gets built once on demand)
  • remove all "don't prefill" defines (Atari, mac68k)

display.c

  • don't blindly rebuild the whole glyphmap on every level change. It's only needed when the flags actually change
  • populate the glyphmap by iterating over the distinct ranges instead of over all glyphs at once. That way, we don't need to evaluate the huge if statement to find out each glyph's kind

Together with SFSTRUCT_BUFFERING and the rendering optimizations, this cuts down the time for a level change from 30s to about 5s on a stock Amiga 1000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants