RE: [Gamedevlists-brew] porting a database file from BREW to J2ME
Brought to you by:
vexxed72
From: Tom H. <to...@am...> - 2004-12-11 20:36:00
|
> -----Original Message----- > 1) Has anyone noticed a phone that completely decompresses the JAR, > including non-class files, into memory when the app is first loaded? That > is, do all known J2ME phones keep the resources compressed until > requested? Yes. A file is only loaded into memory when you open it. To be even more specific, if you're loading a 100k file and using the stream mechanism to get to a record 50k in, then 50k of the file will be loaded into memory. So far I haven't found a phone that would let you seek to the 50k mark without having the preceding 50k in your heap. As I figure it, this is due to the file you're loading being zipped inside the jar, so you need to decompress from the start to the point where you want ... you can't just jump to it. In case it isn't obvious, this also means you have significant performance issues if you're going to be seeking all over the place in a file. It might be interesting to just store the file in the jar, and not deflate it. Maybe it would allow you do seek with good performance and without hitting the heap if the file isn't compressed. You would need to create the it with a tool other than jar, or modify the jar with WinZip after or something. > 2) Do any phones degrade in performance when large numbers of small files > are stored in the jar file? I haven't run into any performance issues, but there's a pretty large overhead per file (~150 bytes) so if download size is a concern having lots of files is a very bad thing. Tom |