est31 wrote:wow, that made it blazingly fast. thanks! Can you make that patch an option?
I've already been doing some work on polishing it, integrating it with the existing functionality, and making it and 'official' option. But there's still work to do - it's more work than I expected...
I guess its still better for larger areas.
Probably not, actually...
Mapping a larger area with a lot of emtpy space causes a lot of non-existant nodes to be queried in vain, and a lot of needless CPU cycles to be wasted on that - as you found out by not limiting the Y range :-) That's the tradeoff. For areas that contain a small percentage of the world's nodes, and a high percentage of existing blocks, this patch speeds up mapping. In other cases it can slow it down tremendously, and it is better to limit the search by getting a block list first.
I tested it on VanessaE's world, mapping areas of 1k, 4k, 16k and 64k (i.e. the full world), and limiting the Y direction: Do compare the 'query' and 'read' columns, for the number of blocks queried, and the number of blocks actually read from the database:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
Backend Size Y Opt Query Read Render Area Total User Sys Time CPU Input Output
leveldb 1024 63 no 0.0M 0.0M 0.0M 0.0M 0.0M 61.1 12.5 1:19 92% 17.401M 520
leveldb 1024 63 yes 0.0M 0.0M 0.0M 0.0M 0.0M 2.3 0.1 0:03 80% 0.077M 520
leveldb 4096 63 no 0.2M 0.2M 0.2M 0.1M 0.1M 88.9 13.7 1:52 91% 17.656M 792
leveldb 4096 63 yes 0.3M 0.2M 0.2M 0.1M 0.1M 30.6 0.7 0:34 89% 0.401M 792
leveldb 16384 63 no 1.1M 1.1M 1.1M 0.3M 1.0M 199.5 14.7 3:50 92% 18.378M 1752
leveldb 16384 63 yes 7.0M 1.1M 1.1M 1.0M 1.0M 181.4 2.7 3:17 93% 1.504M 1752
leveldb 65536 63 no 1.3M 1.3M 1.3M 0.3M 6.5M 248.2 14.2 4:39 93% 18.613M 2088
leveldb 65536 63 yes 126.7M 1.3M 1.3M 16.0M 16.0M 1136.2 4.4 19:23 98% 2.320M 2168
leveldb 65536 255 no 3.0M 3.0M 3.0M 0.3M 6.5M 424.4 14.8 7:40 95% 18.944M 2096
leveldb 65536 255 yes 507.1M 3.0M 3.0M 16.0M 16.0M 3931.0 8.5 1:06:26 98% 3.480M 2184
BTW: This table also shows how
extremely inefficient the leveldb database is at obtaining the block list... It probably just reads the entire database...