Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove magic and enchantment includes in character.h #42680

Merged
merged 2 commits into from
Aug 3, 2020

Conversation

anothersimulacrum
Copy link
Member

Summary

SUMMARY: None

Purpose of change

In an effort to speed up build times, replace that variables that use these with pimpls and remove the headers.

Describe the solution

Add/remove the necessary includes and change accessors to ->

Testing

Compiles.

Additional context

Here's what character.h looks like on #42675, let's see if we can beat that.

127505 ms: src/character.h (included 142 times, avg 897 ms), included via:
  npc.o npc.h  (1358 ms)
  npcmove.o npc.h  (1338 ms)
  ranged.o avatar.h  (1335 ms)
  avatar.o avatar.h  (1332 ms)
  newcharacter.o avatar.h  (1306 ms)
  monexamine.o avatar.h  (1300 ms)
  ...

75408 ms: ../src/character.h (included 62 times, avg 1216 ms), included via:
  itemname_test.o  (1396 ms)
  comestible_test.o  (1393 ms)
  item_location_test.o  (1392 ms)
  item_tname_test.o  (1376 ms)
  char_healing_test.o avatar.h  (1369 ms)
  reload_magazine_test.o  (1368 ms)
  ...

@anothersimulacrum anothersimulacrum added [C++] Changes (can be) made in C++. Previously named `Code` Code: Build Issues regarding different builds and build environments Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Aug 3, 2020
@kevingranade
Copy link
Member

Obsoleted by #42679 if it does what it's supposed to do.

@anothersimulacrum
Copy link
Member Author

I think this is potentially still worth having so that touching magic_enchantment.h and magic.h don't mean you also need to recompile everything character.h touches.

src/character.h Outdated Show resolved Hide resolved
@anothersimulacrum
Copy link
Member Author

I like it.

 90783 ms: src/character.h (included 142 times, avg 639 ms), included via:
  talker_npc.o avatar.h  (945 ms)
  monexamine.o avatar.h  (943 ms)
  talker_avatar.o avatar.h  (935 ms)
  melee.o avatar.h  (929 ms)
  map_field.o avatar.h  (927 ms)
  activity_item_handling.o avatar.h  (922 ms)
  ...
53129 ms: ../src/character.h (included 62 times, avg 856 ms), included via:
  item_location_test.o  (1008 ms)
  item_tname_test.o  (1004 ms)
  itemname_test.o  (1002 ms)
  comestible_test.o  (994 ms)
  vehicle_split_test.o  (986 ms)
  iuse_test.o avatar.h  (966 ms)
  ...

In an effort to speed up build times, replace that variables that use
these with pimpl<T>s and remove the headers.
@kevingranade
Copy link
Member

Ok yea considering the relatively low amount of impact and churn here, I'll buy doing both.

@kevingranade kevingranade merged commit 5e8dc90 into CleverRaven:master Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Build Issues regarding different builds and build environments Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants