ajusa / VNDS-LOVE

A visual novel player for Windows, Mac, Linux, and the Nintendo Switch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3DS Performance Improvements

ajusa opened this issue · comments

Describe the bug
3DS currently has multiple issues with performance, particularly on IO heavy loads.

To Reproduce
Steps to reproduce the behavior:
Play a novel with sound on.

Try profiling both the script load function and just the audio loads to avoid having the profiler mess up the main event loop.

After profiling script load, found that the ascii function was the main culprit. Rewrote it to be much faster and now script loads are acceptably fast. After profiling audio seems like all of the time is spent in LovePotion calls, not sure why it seems to be slow.

After doing some more digging around and asking the folks on the LovePotion Discord, it seems that the filesystem itself might be the bottleneck when it comes to indexing to a certain file among thousands in a directory.
Options are

  1. Trying to load from a zip file, after PhysFS support is fixed on 3DS
  2. Having a 3DS converter that hashes filenames into a folder in an attempt to split up thousands of files into hundreds per directory

ZIP support was added to VNDSx precisely for loading time reasons. That's why it only supports uncompressed ZIP files.