Skip to content

[Code] Remove Lua Rule Constants#4949

Merged
Kinglykrab merged 1 commit intomasterfrom
akkadius/remove-constant-rules
Jun 22, 2025
Merged

[Code] Remove Lua Rule Constants#4949
Kinglykrab merged 1 commit intomasterfrom
akkadius/remove-constant-rules

Conversation

@Akkadius
Copy link
Copy Markdown
Contributor

Description

This is based off of efforts to cleanup the codebase, modernize and make it more efficient.

I have a branch called build-analyze that runs a trace of what takes up all of the build time (example here http://drone.akkadius.com/EQEmu/Server/18259/1/2)

This shows that lua_register_rules_const takes 49 seconds to compile and does a lot of expensive things to provide rule constants that I've not found used in any quest codebase. The cost is not worth the benefit considering it's been in the codebase for 8 years and no utilization.

**** Functions that took longest to compile:
 48183 ms: lua_register_rules_const() (/drone/src/build/zone/CMakeFiles/lua_zone.dir/Unity/unity_1_cxx.cxx)
  9943 ms: __cxx_global_var_init.273 (/drone/src/common/rulesys.cpp)
  9600 ms: lua_register_packet_opcodes() (/drone/src/build/zone/CMakeFiles/lua_zone.dir/Unity/unity_2_cxx.cxx)
  6036 ms: __cxx_global_var_init.230 (/drone/src/common/database/database_update.cpp)
  5716 ms: __cxx_global_var_init.198 (/drone/src/common/database/database_update_manifest.cpp)
  5555 ms: BaseCharacterDataRepository::UpdateOne(Database&, BaseCharacterDataR... (/drone/src/zone/client_packet.cpp)
  4800 ms: BaseCharacterDataRepository::UpdateOne(Database&, BaseCharacterDataR... (/drone/src/zone/client.cpp)
  4699 ms: BaseNpcTypesRepository::UpdateOne(Database&, BaseNpcTypesRepository:... (/drone/src/zone/npc.cpp)
  4683 ms: _GLOBAL__sub_I_bot_raid.cpp (/drone/src/zone/bot_raid.cpp)

Type of change

  • Build optimization

Testing

Basic processes still work

Checklist

  • I have tested my changes
  • I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
  • I own the changes of my code and take responsibility for the potential issues that occur

@Kinglykrab Kinglykrab merged commit f8ee664 into master Jun 22, 2025
2 checks passed
@Kinglykrab Kinglykrab deleted the akkadius/remove-constant-rules branch June 22, 2025 17:55
@Akkadius Akkadius mentioned this pull request Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants