OneLife icon indicating copy to clipboard operation
OneLife copied to clipboard

Perfomance of longTermCulling.

Open AlecYawata opened this issue 7 years ago • 2 comments

When I set "10" to "server/settings/longTermNoLookCullSeconds.ini", I saw log of same position, again and again.

Log is like:

setMapObject( -3, 17, 30) setMapObject( -8, 21, 50) setMapObject( 8, 38, 50) setMapObject( -2, 5, 50) setMapObject( -6, 8, 50) setMapObject( -3, 17, 30) setMapObject( -8, 21, 50) setMapObject( 8, 38, 50) setMapObject( -2, 5, 50) setMapObject( -6, 8, 50) setMapObject( -3, 17, 30) setMapObject( -8, 21, 50) setMapObject( 8, 38, 50) setMapObject( -2, 5, 50) setMapObject( -6, 8, 50)

That means, server calls setMapObject() by same position and objectId, at every steps. Is that good performance for server? db's record keep increasing forever, until server shutdown(relaunching culling is enable and good, that remove db's records.) In last day of before update, db's record is almost fill by ghost record deleted by longTermCulling, and server still repeat deleting ghost.

Maybe good implementation is delete records of db, timeDb, floorDb, floorTimeDb, instead of "setMapObject".

This is logging source code. ` if( curTime - lastLookTime > longTermCullingSeconds ) { // stale

                if( noCullItemList.getElementIndex( tileID ) == -1 ) {
                    // not on our no-cull list
                    clearAllContained( x, y );

                    // This is logging by AlecYawata
                    AppLog::infoF( "setMapObject( %d, %d, %d)", x, y, getTweakedBaseMap(x, y));

                    // put proc-genned map value in there
                    setMapObject( x, y, getTweakedBaseMap( x, y ) );
                    }
                }`

BTW, I researching "Animals has gone after longTermCulling bug".

AlecYawata avatar Jun 11 '19 15:06 AlecYawata

Oh,,, I didnt know, db record can not be deleted.... Very difficult problem.

AlecYawata avatar Jun 11 '19 15:06 AlecYawata

Yes, but you're right that there's no sense in setting it over and over, once it has been set during culling one time.

I did end up fixing this a bit here:

0da4755c3d8b9aafde19053db9c606746071dc62

jasonrohrer avatar Jun 12 '19 18:06 jasonrohrer