Jump to content

Recommended Posts

Posted (edited)

i think can be done with many ways:

_list.remove(_list.indexOf(itemId));
_list.remove(Integer.valueOf(ItemId));
_list.remove(new Integer(itemId));

But the critical its to find the best performance.

Edited by StinkyMadness
Posted
15 minutes ago, Rootware said:

@Tryskell my example works correct. I get index first and after remove object from ArrayList by him index. What's wrong? All follows Eclipse documentation.

 

Until JIT does its work and saves the day, it's (probably) costier.

Posted
5 minutes ago, StinkyMadness said:

i think can be done with many ways:


_list.remove(_list.indexOf(itemId));
_list.remove(Integer.valueOf(ItemId));
_list.remove(new Integer(itemId));

But the critical its to find the best performance.

 

In your case not matter "best way", because too small list for feeling difference. Less few billions object in list pointless for catching performance.

Posted (edited)
19 minutes ago, Rootware said:

 

In your case not matter "best way", because too small list for feeling difference. Less few billions object in list pointless for catching performance.


Yes but is one list for each player... if all use it you better find best performance.
In other way already work with (Integer itemId)

Edited by StinkyMadness
Posted
10 minutes ago, Rootware said:

 

In your case not matter "best way", because too small list for feeling difference. Less few billions object in list pointless for catching performance.

 

remove(Integer.valueOf(

is the regular writing style, over L2J and aCis. End of story.

Posted (edited)
12 hours ago, StinkyMadness said:


Yes but is one list for each player... if all use it you better find best performance.
In other way already work with (Integer itemId)

 

If you cares about player instance, as multiplier can change performance, then cares about cleanup any customs from any this instance. By the way, everyone player's instance it's another thread and not matter how many time will be done list's operation. In your case this difference less 0,00001 second.

 

The general story line was in style of coding. :aproove-smile:

Edited by Rootware
  • Thanks 1
Posted
1 hour ago, Rootware said:

 

If you cares about player instance, as multiplier can change performance, then cares about cleanup any customs from any this instance. By the way, everyone player's instance it's another thread and not matter how many time will be done list's operation. In your case this difference less 0,00001 second.

 

The general story line was in style of coding. :aproove-smile:


i know player's instance its already kinda mess xD i'm just telling that there are 3 or more ways that are doing the same job.. i care to learn.. the best performance.. not only for this case...

Posted

I always felt like things like this have more of a place in the CommunityBoard, instead of the NpcHtml. You have more space and to add more things. Also previous/next pagination can get hectic without numbered pagination so I would add that.

 

In terms of the code the following can be optimized:

npc.getDropData().forEach(c -> list.add(c));
Collections.reverse(list);

You can iterate over the getDropData() enumerable in a reverse fashion in order to prevent the reverse call. You just add the objects in reverse before hand.

 

You can move "final int ITEMS_PER_LIST = 7;" outside of the static method to prevent the allocation to the object every time the method is called.

 

You should chain sb.append within your sb.append calls. Strings are immutable so you're allocating more memory for no reason.

 

You can change this:

 

if (_ignored.contains(itemId))
       _ignored.remove(itemId);
   else
       _ignored.add(itemId);

To this:

 

var existed = _ignored.remove(itemId);
if(!existed)
    _ignored.add(itemId);

 

You also should rename the public methods "ignoredDropContain" and "ignored" in Player.java. They are really bad names and they don't imply what they do. They also don't belong in the Player class.

 

There are other small things as well but too nit picky to mention.

  • Upvote 1
Posted (edited)

Hi, is this compatible with Interlude? Thanks! 

 

Never mind :), i successfully implemented it on my private server. The only question I have, what does the check boxes actually do? How do they work? Because i can't see any changes whatsoever.

Edited by stalker66
  • 3 weeks later...
  • 3 weeks later...
  • 1 month later...
  • 2 weeks later...
  • 2 weeks later...

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



  • Posts

    • Ты настолько смешон, что создал специально для этого левый аккаунт?)))  ты не стоишь даже капли с моего члена что бы я ради тебя писал что-то на анг)  Человек видимо облажался с запуском, слил бабки в помойку теперь с горящей жопой бегает по форуму и не знает кого обвинить))))) перечитай что я тебе написал, мне насрать на тебя на твой сервер и на то что ты там выложил)  это все дерьмо неактуально уже давно, скажу тебе если твоя тупая голова это не поняла, АКТУАЛЬНОЕ НИКТО НЕ ПРОДАЕТ, потому что любая продажа это = шара, все что продается ЭТО ОТЪЕЗЖЕННОЕ ГОВНО которое не нужно хозяину, старое как твои обвисшие от гнева сиськи    
    • L2 HARMONY - BANNERS & ICONS       L2 COLD - NPC ANIMATED BANNER
    • LA ERA DE EINHASAD - Lineage 2 en Castellano Lineage II Crónica 4: Vástagos del Destino x5 - Main Class - Full Craft ───────────────────────────── La diosa Einhasad ha despertado... Una nueva era comienza para los verdaderos aventureros. Un mundo completamente traducido al español, fiel al Lineage II original, creado para una comunidad hispanohablante unida por la nostalgia y la pasión. ───────────────────────────── APERTURA OFICIAL: 14 de NOVIEMBRE - 20:00hs (GMT-3) ───────────────────────────── INFORMACIÓN PRINCIPAL Rates: x5 Tipo: Main Class Sistema: Full Craft Idioma: 100% Español (traducción completa del juego) Comunidad hispanohablante Balance original con mínimas modificaciones Buffer Offline, los jugadores pueden crear sus tiendas de buffs Progresión de crónicas cada 4 meses aprox. Economía estable - Sin Pay to Win - No venta de items/adena por donación Comunidad de 1.000 personas Anterior versión x1 duro casi 3 años con 952 IPs distintas de pico ───────────────────────────── CARACTERÍSTICAS DESTACADAS Experiencia fiel al Lineage II clásico, sin alteraciones invasivas Interfaz, diálogos y objetos completamente en español Ventana de comunidad con servicios personalizados y comercio por Monedas de Oro Olimpiadas, Épicos y Asedios originales Recompensas por votación, Eventos TVT con 3 arenas diferentes. Participan todos sin importar el nivel, pero dentro de la arena solo se atacan por rango cercano Soporte activo y presencia constante del administrador Tickets de soporte con atención rápida en Discord ante cualquier problema ───────────────────────────── ENLACES OFICIALES Website: La Era de Einhasad Discord: https://discord.com/invite/A6PtCCN2SF ───────────────────────────── Una comunidad unida por el idioma, la pasión y la nostalgia. Redescubrí Aden… en tu propio idioma. Bienvenido a La Era de Einhasad.  
    • English you belarus retard ) Seems you so desperate and angry cant even speak back in EN, well guys you see how its easy to destroy scammer xD
    • Чувак) мне на него насрать давно, ты не мне сделал подлянку а людям которые купили и используют. Я его удалил год назад) когда закрыл продажи.   мне вообще похер кто ты и что ты.    Можешь сесть и попрыгать на тот же член на котором ты прыгаешь все это время) и этой версии более 3х лет) ты откопал залупу мамонта , поздравляю)) кто скачает это дерьмо используйте на свой страх и риск)) кто знает что там наворочено)))  удачи в шаринге обиженный жизнью неандерталец.   Можешь лизнуть мое очко на прощание.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock