Jump to content

Faster loading: cache the datastructures to disk in a blob


Recommended Posts

Cache the parsed results of all those very fluffy and very wordy text files in GameData and store the resulting data structures as a big blob.  If any file are updated, then just parse as is the norm at startup now, otherwise just mmap that blob and go

Link to comment
Share on other sites

that is actually not the reason why KSP loads so slowly - and caching wouldn't do much to help, I think.

the real reason for the long loading times is that KSP has to load everything up front - so even parts you have never used are parsed and loaded along with all their models, textures and whatnot when the game starts up.

I've considered making a mod that replaces parts with a fast-loading surrogate of sorts and then replaces them with their full versions only when and if they are actually used.... It's theoretically possible to pull this off, but not being a rich man, I am unable to spare that much effort into such an endeavor.

 

This was actually something I made a point of avoiding when I made the part-loading logic for my own MotorWings project - It only loads parts when you pick them up for placement or load an airplane that uses them.  It's startup time from desktop to hangar is negligible because of this.

 

Thus I can confidently say that caching those text files would alas, most probably not really help KSP load any much faster...

 

 

Edited by Moach
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...