Jump to content

Branch: bs-coreoptimize (Introduction)


Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   32
  • Joined:  11/18/11
  • Last Seen:  

Okay,

here i'll provide some informations about branches/bs-coreoptimize.

I just set up several milestones i want to reach in the future.

The most of them are performance optimizations, as well was

cleaning up messed up stuff (messed up == (crappy / unusable | usability fail). )

I'll try to keep the branch runnable / compileable the whole time,

but you've been warned - the branch is not proposed to use in production environments -

due to heavy changes in several essential subsystems.

Every "completed" Milestone will be announced and after some testing

(i'll probably tag it so you can give feedback before its getting applied to mainline.)

will be merged back 'down' to trunk (and probably upcomming versions / branches...).

So here's the List:

#1 Milestone

Core Related

  • Add Threading Abstraction (Windows / Linux / BSD)
  • Add Synchronization Abstraction (Windows / Linux / BSD)
  • Add Atomic (CAS/ADD/EXCHANGE) Abstraction (MSC/GCC on x86 and x86_64)
  • Add Generic threadsafe Memory-Pool implementation for preallocation (with asynchronous reallocator)
    to guarantee a fast / cost effective on demand allocation and reduce the memory fragmentation during runtime.
  • Add generic 'athenastyle' configuration parser (to get rid of (n)x fscanf based parsers in every app.)
    this version is also 'improved' by allowing ini style declaration and comments, as well as Sections.
  • Improve timing source (gettick)
    ~ Improve accuracy
    ~ Reduce overhead
    ~ Redcuce syscalls
    (On 32bit releases: Add warning/hint that the tickcount will overflow all ~24,8 day to restart the server before that happens!)
  • Add IOBuffer subsystem (threadsafe / for new network subsystem)
  • Add new Network subsystem to replace old 'socket' stuff
    ~ Improve Performance
    ~ Reduce Latency
    Using platform specific API's:
    Windows => IO Completion Ports (overlapped stuff wink.png
    Linux 2.6.9+ => epoll
    FreeBSD => kqueue
    other => select (as fallback)
    ~ More details when its getting implemented wink.png
  • Add asynchronous workers (so stuff can be done in threads)
    For example: handling npc SQL querys async. so it wont block the server anymore.
    (Script will be yielded until result's got back from SQL/Worker thread.)

Build / Release Related

  • [T] Autoconf (configure): choose 64bit build by default, when building on 64bit platform.
    (So --enable-64bit will be dropped, and --disable-64bit will be added to enforce 32bit build in/on 64bit environments.)
  • [T] Autoconf (configure): add LTO (Linktime Optimization) detection / support for newer gcc / binutils versions.
  • Autoconf (configure): drop --enable-rdtsc (when new timing source / method gets implemented)
    Reading / using the tsc counter as time source is unsafe when running on older cpus or under several virtualized environments .. sad.png
  • Autoconf (configure): (gcc platforms) due to changes done with atomic operations, require at least i686
    (which is an old Pentium PRO or K6-III ..)
  • Autoconf (configure): add --with-maxconn option to override the default max conn limit of the new network subystem (defualt: 16384)
  • [T] Makefiles: cleanup build output (convert to kernel style build output.)
  • [T] Makefiles: cleanup core dependency handling in subprojects (such as loginserver or charserver..)
    ~ by generating the common(core) as a static lib (ar) and link the subprojects against it.
  • [T] Makefiles: cleanup core header file dependencies in subprojects, simply require all core/common headers.
  • VC10: Cleanup / recreate the Solution
    ~ Building common(core) as static lib as well as the 3rdparty deps and link all subprojects against it.
    ~ Add 64bit target support for Windows platforms.

Generic / Other

  • Replace binary ZLib disitribution for windows with source (to be able to produce 64bit windows binarys).
  • Replace / Update MySQL distribution from 5.0.20 to 5.5.x 32bit as well as 64bit (to support 64bit windows binarys).

Color Legend:

  • Green Text => Finished Tasks
  • Red Text => Dropped Tasks (due to incompatibilities or such..)

Prefix / Symbol Legend:

  • [T] => Merged/Applied to trunk (feature available @ trunk)

I'll keep you posted ..

You can reach me via PM or IRC (irc.rathena.org #rathena / Nick: Sirius_Black)

Florian

Edited by Sirius_Black
Updated merge status ..
  • Upvote 12
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  175
  • Reputation:   8
  • Joined:  03/10/12
  • Last Seen:  

I'd say this is awesome! :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

What do you plan on touching with threads first?

Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   32
  • Joined:  11/18/11
  • Last Seen:  

What do you plan on touching with threads first?

Sorry for the long delay - i was really busy the last 3 weeks.

First planned thing that will be handled async. by threads -> Database access.

#1 NPC SQL Stuff

#2 Loading / Saving of stuff directly @ mapserver whenever its possible, not over charserver.

..

Florian

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

I'm happy with most of the staff and thanks for your great work, but I have only one concern. The tickcount overflow in 32 bit systems. Honestly I doubt that we need that big resolution for timers, so maybe it would worth to sacrafice a bit accuracy to avoid those overflows.

Anyways huuuuge +1 for moving SQL operations to another thread.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   101
  • Joined:  11/13/11
  • Last Seen:  

I'm happy with most of the staff and thanks for your great work, but I have only one concern. The tickcount overflow in 32 bit systems. Honestly I doubt that we need that big resolution for timers, so maybe it would worth to sacrafice a bit accuracy to avoid those overflows.

Anyways huuuuge +1 for moving SQL operations to another thread.

At least on windows to get the ticks we depend either on GetTickCount, that will overflow and you can't avoid that, or sticky to the high resolution timer.

Even using HR timer on 32 bits systems will overflow if you don't want to use QWords(if you use QWords you can use GetTickCount64).

btw I think that GetTickCount and GetTickCount64 are dependent on the system HR timer, so we still use it indirectly(or they use the PIC timer counter?, i don't remember >.<).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

Of course, we can not avoid overflows completely, but 25 days sounds way to frequent to me =(.

  • Upvote 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...