Jump to content
Sign in to follow this  
mosinnik

Оптимизация движка геодаты в L2J

Recommended Posts

Занимался какое-то время оптимизацией потребления памяти GeoDriver от L2J и его скоростью работы. По памяти 40-45% экономии, по скорости получения высот из геодрайвера до пяти раз быстрее на отдельных типах блоков.
Код на гитхабе: https://github.com/mosinnik/l2-geo
И еще статейку на хабр накидал о том что и почему было сделано: https://habr.com/ru/articles/1000082/

Share this post


Link to post
Share on other sites

А что ты сделал то?
Как было все плохо, так и осталось.
Как был распухший до боли Region с IBlock[] массивом который сжирает сотни и тысячи мегабайт, так и осталось.
Теперь сравни с моим:

private final ByteBuffer types; 
@Override
public int getNearestZ(int x, int y, int z) {
    final int offset = getBlockOffset(x, y);
    final byte type = types.get(offset);
    return switch (type) {
        case FLAT -> readFlatZ(offset + 1); 
        case COMPLEX -> readComplexZ(offset + 1, x, y, z);
        ////////..................
    };
}

 

Share this post


Link to post
Share on other sites
12 часов назад, mosinnik сказал:

@Saltfireпосмотри на GeoDriverBytes 

а к чему тогда остальное все там лежит? 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...