Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should add :force option to :caching parameter for new images #10

Open
banister opened this issue Dec 1, 2010 · 3 comments
Open

Should add :force option to :caching parameter for new images #10

banister opened this issue Dec 1, 2010 · 3 comments

Comments

@banister
Copy link
Owner

banister commented Dec 1, 2010

New images should be able to be lazy-cached (caching: true), non-cached (caching: false) or force-cached (caching: force)

@bil-bas
Copy link
Collaborator

bil-bas commented Dec 2, 2010

For your information, I turn off syncing globally and caching: true when something fails to work. Seems to be the best way to optimise for me, since I create a LOT of images, many of which I don't need to cache. Not sure of a situation where I'd want to force syncing, though.

@banister
Copy link
Owner Author

banister commented Dec 2, 2010

Hey homie,

The problem with relying on lazy cache (the current default) is that it waits until image manipulation occurs before it cache the image ---- this means that gameplay will slightly freeze up noticeably for the duration of the initial cache. If we use :cache force however we can move this runtime penalty to level load time (assuming it is the kind of image where this makes sense -- such as a level 'map' / background as in selene).

Using cache: forced has made selene noticeably smoother, and has also not significantly increased level load time as 0.5 second more in load-time is not noticeable but a 0.5 second slow-down in runtime IS noticeable.

The situation is now like this:

  • If you dont intend to manipulate an image, turn caching off (false)
  • If you do intend to manipulate but your focus is on reducing level-load times, use :lazy
  • if you do intend to manipulate and your focus is on run-time performance and you dont mind a tiny increase in level load times, then use forced (true)

alternately you can turn caching off altogether and manually call #cache (or #refresh_cache) on an image at the proper moment.
:)

@bil-bas
Copy link
Collaborator

bil-bas commented Dec 2, 2010

Thanks for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants