Google-Code-Fork / tibiaapi

Automatically exported from code.google.com/p/tibiaapi
MIT License
0 stars 0 forks source link

Caching for TibiaAPI #147

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In several places I've seen where there are calls that read stuff from
memory, where instead, the data they return could be cached.
My suggestions, if accepted, should work for almost any data...

Create the CacheHelper class (just a name off the top of my head), which
can store any kind of data (in any form). It should have methods that allow
returning cached data (casting it) as string, object, int, long, arrays of
X type, etc. Also, methods to convert any kind of data to an array of
bytes, so it can be stored again. 
Should provide ways to invalidate this data, due to expiration because of
elapsed time, character relogged, etc.

I thought this is a better approach than just improving the battlelist
class to cache it's contents, and making something that will be useful in
the long run and for other purposes, like, sprites, tibia dat, etc.

Share your thoughts.

Original issue reported on code.google.com by ing.cabr...@gmail.com on 6 May 2009 at 6:33

GoogleCodeExporter commented 9 years ago
Ian and I talked about this recently. After further discussion I'll let you 
know 
where we stand on this request.

Original comment by joebingham07@gmail.com on 10 Nov 2009 at 7:21

GoogleCodeExporter commented 9 years ago
I don't think this is that useful. If someone can show me some verifiable speed
tests, we may consider implementing that, but until then, there is no need to
optimize prematurely.

Original comment by ian320 on 10 Nov 2009 at 2:44