An idea on how to improve performance

Discussion of development and patch submission.
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

An idea on how to improve performance

Postby Battler » Tue 06 Jun, 2017 8:39 pm

This is the message I got from someone I know on another forum, she had this to say:

It's slow(er in the OS when address translation is enabled) because of the TLB not being emulated 'properly', leading to a fetch from the page tables each time an instruction that references memory is accessed. See src/mem.c, mmutranslate_read. You end up incurring a giant performance penalty when a fetch has to occur from memory for each instruction that references a translated address.

It might be best to have a hash table that corresponds to an input address and add to buckets inside for the corresponding address translation (including removing translations from the htab when they need to be evicted), or you can do what MAME does (see and have a giant allocated memory chunk where the software managed TLB entries can lie. Either approach should work.

This might improve performance.

Maybe this TLB stuff should be looked to. I have no idea where this observation is right because my knowledge on the subject is not that great, but she is an experienced developer and has extensive knowledge on this kind of thing.
Site Admin
Posts: 1328
Joined: Thu 24 Apr, 2014 4:18 pm

Re: An idea on how to improve performance

Postby SarahWalker » Tue 06 Jun, 2017 8:44 pm

This is only correct for memory mapped IO. Accesses to RAM go through the readlookup/writelookup tables, and never go to anything in mem.c.

I did look at altering the memory code to allow MMIO to go through this fast path as well, but it didn't bring anything like enough improvement to justify the additional complexity.

Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests