[josm-dev] Jumbo Patch
Petr Nejedly
Petr.Nejedly at Sun.COM
Mon Dec 17 22:22:54 GMT 2007
Frederik Ramm napsal(a):
> On the other hand, if we re-write anyway, then we might just ditch
> Java altogether and do it in C++, or maybe simply use Merkaator as a
> start (don't know how well it is designed on the inside but it is a
> fast C++ app that compiles easily on Win, Mac and Linux which is
> probably enough for us). If people are really concerned about memory
> usage and such (as in "you can't keep a list of ways with every node
> as even the empty list will consume 80 bytes") there's just no beating
> good old C++.
Really? Oh come on, you need to know your libraries, regardless of the language.
Smallest possible growing list implementation would consume 32B (for single-slot,
but still with the possibility of growing transparently) - one object with two
fields and an object array.
How much would it be in C++? You'll need two objects as well. You could (and would)
inline one of them into the other data structure (Node in this case) thus saving
one object header, but the fields will still be there. And in both cases, you can
take the path of reused field and 4B/singleslot for typical case. At least as long
as RTTI works for you in your C++ implementation.
--
Petr "Nenik" Nejedly, NetBeans/Sun Microsystems, http://www.netbeans.org
355/113 -- Not the famous irrational number PI, but an incredible simulation!
More information about the josm-dev
mailing list