ketoo / NoahGameFrame

A fast, scalable, distributed game server engine/framework for C++, include the actor library, network library, can be used as a real time multiplayer game engine ( MMO RPG/MOBA ), which support C#/Lua script/ Unity3d, Cocos2dx and plan to support Unreal.
https://github.com/ketoo/NoahGameFrame/wiki
Apache License 2.0
3.97k stars 1.09k forks source link

[PR] module optimize #254

Closed mingbujian closed 4 years ago

mingbujian commented 4 years ago

1、reduce the time overhead of the module

ketoo commented 4 years ago

Your PR shows that the variable NFIModule:: m_bIsExecute will decide the module be executed or not, but actually we have config file to let NF know a plugin can be executed or not. So is that necessary to add a new variable for a similar feature and let developers change it by hard code?

mingbujian commented 4 years ago

Adding this tag can make developers realize that some modules do not need to be ticked every time, but they can still obtain modules from the plugin management and use them (after all, some modules only provide interfaces). For example:m_pModule = pPluginManager->FindModule<NFIHelloWorld4Module>();

ketoo commented 4 years ago

Great idea!

I think most of these modules don't need to be ticked every time. Maybe only the schedule module and some network modules.

mingbujian commented 4 years ago

Among many new functional modules, of the 10 additional functional modules, only 2 need to be ticked. Since the tick is too low-level, I hope to optimize it.

ketoo commented 4 years ago

Among many new functional modules, of the 10 additional functional modules, only 2 need to be ticked. Since the tick is too low-level, I hope to optimize it.

Yes, I agree with you, could you please let the default value is false for variable m_bIsExecute as most of the time it should be false. Besides I will modify the constructor for the modules which need to be ticked, you could do the same if you like to do.

mingbujian commented 4 years ago

Yes, whether the module is ticked should be set to flase. Already processed