-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
There was a problem hiding this 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.
ports/atmel-samd/Makefile
Outdated
@@ -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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
As an alternative to listing SRC_QSTR_PREPROCESSOR, you could just add special comments in the source that isn't otherwise caught by grep, |
There was a problem hiding this 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 :)
@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. |
Looks to save 15 seconds or so. The compiler catches when this fails because the QSTR is missing when it does.