--- deliantra/server/ext/map-random.ext 2008/05/08 14:20:19 1.30 +++ deliantra/server/ext/map-random.ext 2009/11/08 22:28:10 1.35 @@ -57,7 +57,7 @@ } sub clean_random_maps { - my $files = Coro::AIO::aio_readdir $cf::RANDOMDIR + my $files = Coro::AIO::aio_readdirx $cf::RANDOMDIR, IO::AIO::READDIR_STAT_ORDER or return; my $META_TIMEOUT = $cf::CFG{map_random_meta_timeout} || 86400 * 7; @@ -154,8 +154,8 @@ $map->generate_random_map ({ region => "scorn", random_seed => $seed++, - xsize => (int rand 500) + 1, - ysize => (int rand 500) + 1, + xsize => (int rand 100) + 1, + ysize => (int rand 100) + 1, }); warn sprintf "%d: %dx%d o# %d\n", $seed, $map->width, $map->height, &cf::object::objects_size;#d# $map->destroy; @@ -175,6 +175,26 @@ } }; } + +# save test +if (0) { + cf::async { + # 0.58 + Coro::Timer::sleep 2; + my $map = cf::map::find "/mlab/citydeclouds2"; + $map->load_header; + $map->load; + $map->post_load_original; + my $m=100; + for (1..50) { + my $t=EV::time; + $map->_save_objects ("/tmp/x", cf::IO_HEADER | cf::IO_OBJECTS | cf::IO_UNIQUES); + $t = EV::time-$t; + $m=$t if $m>$t; + warn $m; + } + }; +} 1