0 Favourites

Writing to INI every step at runtime slows down

This forum is currently in read-only mode.
  • Could someone explain to me why writing to an INI file every step (adding string) slows down the application significantly, while doing the same thing with a hash table causes almost no change in Framerate?

    The string added every step is basically just the number of the .X position of a sprite and a comma.

    The Framerate doesn't drop instantly either (testing in Unlimited FPS mode), but after a while. So I thought it might have something to do with the INI file getting too large? And that every consecutive time it needs to search longer for the end-position to to add the next string to.

    Thank You in advance.

  • INI writes to disk, and you should never constantly write to disk like that! It's far too slow to be practical. You should only save to INI once, like at the end of the layout, or when the user clicks save. Hash table is all done in memory so there's no slowdown from going to disk at all.

  • INI writes to disk, and you should never constantly write to disk like that! It's far too slow to be practical. You should only save to INI once, like at the end of the layout, or when the user clicks save. Hash table is all done in memory so there's no slowdown from going to disk at all.

    Thank You, Ashley. <img src="smileys/smiley1.gif" border="0" align="middle" /> Gives me some clues as to what to research next, the difference in disk memory and RAM, and how exactly they work.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Ashley, I have a little question with the save to ini thing.

    Here's an image from a .cap, I found on the russian construct forum:

    <img src="http://dl.dropbox.com/u/26932498/2p_ini.jpg" border="0" />

    How does it exactly work? Couldn't find any file on the folder I've chosen at the start, but it works. I have 2 .cap files for both player. Just couldn't figure out how :P. And it saves every tick the position?

  • How does it exactly work? Couldn't find any file on the folder I've chosen at the start, but it works. I have 2 .cap files for both player. Just couldn't figure out how :P. And it saves every tick the position?The file that is written to, is defined in "Start of layout" as "sety.dat". Yes, it writes to disk on every tick. I wouldn't recommend copying such a method.

  • Couldn't find any "sety" file on my computer. I choose "desktop" for the location. That's the thing I was wondering about. I started both applications, for player 1 and player 2. Selected the same directory and they didn't created the file there.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)