Reducing memory usage by shortening file names

Blitz3D Forums/Blitz3D Beginners Area/Reducing memory usage by shortening file names

fox95871(Posted 2008) [#1]
I was wondering, how much difference does it make if you load image files with shorter names? I think I'm getting to the point now where my engine's starting to slow down or at least take a lot longer to load possibly because I have mostly all long names for my pngs. The reason I have them so long is because it helps me to have them be as descriptive as possible while I'm still designing everything, but if shortening them to 8 letters or even 4 later would speed things up, I'll do that for the final exe.

My biggest questions are,
1. If there is an effect, does it speed up just the initial loading time, the speed of the program while it's running, or both?
2. Would not using a file path and just putting all the files in the same folder help?
3. If 8 letters is faster, is 4 even better than that?
4. Do the characters used in the extension count, like does .png add an additional 4 characters?

Thanks, I'd test this all myself but I have over a hundred files now for my dropdown menus, and changing them all to 8 and then 4, plus changing them in the code would take forever, so I thought if someone here already knows that would definitely save me some time.


big10p(Posted 2008) [#2]
The length of your file names will have no impact on the speed of execution, whatsoever. Look for speed optimizations elsewhere.


WolRon(Posted 2008) [#3]
Think about it. Loading the FILES THEMSELVES would take thousands of times longer than the time it takes the Operating System to work with the file names.


GfK(Posted 2008) [#4]
Loading time and execution time are nothing to do with the length of filenames.If your program is running slow, there are a million things to check that are further up the list than this is; Memory/vmem usage, inefficient code, memory leaks, bad timing code, polygons and surfaces, collisions, linepicks.....


puki(Posted 2008) [#5]
How long are these filenames currently?


fox95871(Posted 2008) [#6]
Very. I don't know what the longest one is right now cause I'm not at my home computer. I'd say maybe 20 characters. Please don't laugh. It's just to help me at this early stage so I can easily identify them. Hopefully I won't have to change them later, but I will if necessary. WolRon, are you saying yes, it does make a difference? My program still runs fast, but the loading time has become significant since I finished all the menus. I think I was wrong in my first post about it slowing down the program itself because I had some bigger texture files then, but if the length of the file names does contribute I'd like to be aware of it so I can shorten them. Thanks for all your replies.


Ginger Tea(Posted 2008) [#7]
only 20 characters?
ive had some albums that have gone well over 70 characters due to the "album name track number track title" method and ive never seen an mp3 player struggle with them

the file name and length as stated by everyone else is not the issue, the problem (whatever that is) lies elsewhere


Ross C(Posted 2008) [#8]
Why not have a progress bar, or some info screens about the game, to break up the time it takes to load. Works on oblivion :o)


GfK(Posted 2008) [#9]
Very. I don't know what the longest one is right now cause I'm not at my home computer. I'd say maybe 20 characters.
Even if it did make any difference, 20 characters isn't a lot.


puki(Posted 2008) [#10]
I was expecting him to come back and say hundreds.


fox95871(Posted 2008) [#11]
Well they average between 10 and 20, but there are about 130 of them. I guess I won't worry about it too much anymore. It takes a little while to load, but there's really only one reason that's a problem for me. Not to go off topic, but is there a way I can reload textures while my engine's running? I like to go back and forth between Photoshop and my engine to work on the textures, but that means I have to wait for the engine to start every time. If I could find a way to minimize it to the taskbar from fullscreen mode, fix up the texture in Photoshop, then maximize again and maybe have a button that reloads the textures, that would be really helpful.


WolRon(Posted 2008) [#12]
I guess I won't worry about it too much anymore

Dont worry about it at all. Filename lengths are NOT a factor at all.

You must not have understood my post. Loading a file that is AT LEAST 4096 characters (4KB) is already 200 times more information to process than any of your filenames. And I'll bet you most of your files are much, much larger than that.


fox95871(Posted 2008) [#13]
I see. Okay, thanks for all the help.