krofna / Warrior-of-Dreamworld

Warrior of Dreamworld is 2D Massivly Multiplayer Online Role Playing Game with Real-time combat
GNU General Public License v2.0
6 stars 2 forks source link

Improve performance of WorldPackets #20

Open krofna opened 12 years ago

RaitoBezarius commented 12 years ago

So, there are very very long. I will post after graph analysis. Client and Server: Client one: https://gist.github.com/3745516 Server one: https://gist.github.com/3745533

It seems in Server, we make a lot of allocation, we need a pool of memory In Client, it's Animation::Update who take the max of time.

I need more time for support multithreading for Client with gprof.

EDIT: Should Investigate around SpellBox...

krofna commented 12 years ago

The real question is, why the hell it took 1.67ms to return(copy) std::string?

RaitoBezarius commented 12 years ago

Because copy string is too long. Use your proper string class with COW.

krofna commented 12 years ago

Just return std::string&. But still... Do you realise how LONG is 1.67ms???

krofna commented 12 years ago

Spell boxes are never removed if they dont hit, worse, on client side even when hit they dont get removed. I should solve that one.

krofna commented 12 years ago

@FullMetal-Alchimist Please use #wod-dev . Someone (likely the troll) registered the #wod_dev 3 hrs ago. I registered #wod-dev

krofna commented 12 years ago

Try again.

RaitoBezarius commented 12 years ago

I can't join #wod-dev, you must invite me.

RaitoBezarius commented 12 years ago

New perf analysis: https://gist.github.com/3749395 In Server, WorldPacket::Append seems the new cause. In Client, Animation::Update.

krofna commented 12 years ago

NVM use #wod_dev, Irritiable gave me the ownership.

krofna commented 12 years ago

We are loosing alot of time on resizing worldpackets. We should determine packet size in constructor. It seems like its our biggest performance issue.

krofna commented 12 years ago

So... I can either fix this by determining packet size in constructor and make our lives hell or leave it be and kill performance. Pick.

krofna commented 12 years ago

Oh yeah, and we're also getting rid of shared_ptr from spellbox. Its killing performance.

boost::detail::atomic_exchange_and_add(int*, int)

krofna commented 12 years ago

Also, try again ;)

RaitoBezarius commented 12 years ago

So... Okay, make our lives hell like in Matrix, I take the red one. I'll try again.

RaitoBezarius commented 12 years ago

New analysis: https://gist.github.com/3756784

krofna commented 12 years ago

LOL. Nice reference to matrix.

On topic: Perhaps we should not check for SpellBoxes hitting on every server thick, Its really too often. Something I should take into consideration when fixing #11

RaitoBezarius commented 12 years ago

Okay, as you wish.

krofna commented 12 years ago

Changed goal of this issue, tho I am not sure when will I have time to do this. School is getting annoying.

RaitoBezarius commented 12 years ago

My Mathematics Teacher is just awesome, so just for him, School is little fun than expected. [He is a developer]

krofna commented 12 years ago

BTW: I did a static analysis on our code (cppcheck). Turns out we write a pretty damn good code...