FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Glyphmap, glyphs: performance optimizations by ingpaschke · Pull Request #1626 · NetHack/NetHack · GitHub

Glyphmap, glyphs: performance optimizations - #1626

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

Glyphmap, glyphs: performance optimizations#1626
ingpaschke wants to merge 3 commits into
NetHack:m68k-wipfrom
ingpaschke:glyphmap-rebuild-opt

Conversation

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.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL