8000 Speed up QSTR creation by pre-filtering files before pre-processing. by tannewt · Pull Request #1079 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

Speed up QSTR creation by pre-filtering files before pre-processing. #1079

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

Merged
merged 3 commits into from
Aug 2, 2018

Conversation

tannewt
Copy link
Member
@tannewt tannewt commented Aug 2, 2018

Looks to save 15 seconds or so. The compiler catches when this fails because the QSTR is missing when it does.

@tannewt tannewt requested a review from dhalbert August 2, 2018 07:55
Copy link
Collaborator
@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Just the one doc clarification.

@@ -427,6 +427,7 @@ endif
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))

SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) $(STM_SRC_C)
SRC_QSTR_PP += peripherals/samd/$(CHIP_FAMILY)/clocks.c
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you just put in a comment saying the SRC_QSTR_PP files are files that generate QSTRs via a preprocessor macor, or rename it to SRC_QSTR_FROM_PREPROCESSOR or something like that?

SRC_QSTR = $(SRC_MOD) $(filter-out $(SRC_QSTR_IGNORE),$(PY_CORE_O_BASENAME:.o=.c)) $(PY_EXTMOD_O_BASENAME:.o=.c)
# Sources that only hold QSTRs after pre-processing.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see the comment here, but maybe rename it to SRC_QSTR_PREPROCESSOR or SRC_QSTR_CPP.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@jepler
Copy link
jepler commented Aug 2, 2018

As an alternative to listing SRC_QSTR_PREPROCESSOR, you could just add special comments in the source that isn't otherwise caught by grep, // -*- QSTR: process this file. One difficulty with that idea is that the files in question are in the "peripherals" submodule.

Copy link
Collaborator
@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am looking forward to this at home and on travis :)

@dhalbert dhalbert merged commit e7ae5a3 into adafruit:master Aug 2, 2018
@tannewt
Copy link
Member Author
tannewt commented Aug 3, 2018

@jepler I thought about that but this approach keeps it centralized. Both cases are kinda gross (qstr in peripherals and a .c that's included) so hopefully its short term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0