ajusa / VNDS-LOVE

A visual novel player for Windows, Mac, Linux, and the Nintendo Switch
55 stars 5 forks source link

3DS Performance Improvements #16

Open ajusa opened 3 years ago

ajusa commented 3 years ago

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.

ajusa commented 3 years ago

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.

ajusa commented 3 years ago

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
poudink commented 3 years ago

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