-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
ci: bring up benchmark #3776
ci: bring up benchmark #3776
Conversation
- output log - add another cold process
test/benchmark.sh
Outdated
time_render_finish=$(date +%s.%3N -d "$(awk '/.*INFO.*generated in /{print $1}' build.log)") | ||
time_database_saved=$(date +%s.%3N -d "$(awk '/.*DEBUG Database saved/{print $1}' build.log)") | ||
|
||
echo "Load Plugin/Scripts/Database $(_SUBSTRUCTION $time_process_start $time_begin)\nProcess Source $(_SUBSTRUCTION $time_render_start $time_process_start)\nRender Files $(_SUBSTRUCTION $time_render_finish $time_render_start)\nSave Database $(_SUBSTRUCTION $time_database_saved $time_render_finish)" | awk '{printf "| %-28s | %7.3fs |\n",$1" "$2,$3"s"}' |
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.
IMHO this line too long. How about divide this into function like the following?
_MESSAGE_FORMATTER () {
awk '{printf "| %-28s | %7.3fs |\n",$1" "$2,$3"s"}'
}
LOG_TABLE () {
time_begin=$(date +%s -d "$(awk '/.*DEBUG Hexo version/{print $1}' build.log)")
...
load_message="Load Plugin/Scripts/Database $(_SUBSTRUCTION $time_process_start $time_begin)"
process_source_message="Process Source $(_SUBSTRUCTION $time_render_start $time_process_start)"
render_files_message="Render Files $(_SUBSTRUCTION $time_render_finish $time_render_start)"
save_database_message="Save Database $(_SUBSTRUCTION $time_database_saved $time_render_finish)"
echo $load_message | _MESSAGE_FORMATTER
echo $process_source_message | _MESSAGE_FORMATTER
echo $render_files_message | _MESSAGE_FORMATTER
echo $save_database_message | _MESSAGE_FORMATTER
}
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.
Updated.
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.
How about add Total time
?
"Total time $(_SUBSTRUCTION $time_database_saved $time_begin)"
Added. |
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.
LGTM :)
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.
LGTM. It would be nice to see memory consumption too.
@curbengh I'd like to add |
The memory usage is now added |
* ci: bring up benchmark * ci: update benchmark - output log - add another cold process * ci: simplify benchmark code & add total time * ci: add memory usage to benchmark * ci: fix benchmark output format
What does it do?
Add a
benchmark.sh
undertest
directory, used to perform benchmark for every build on travis ci, which enables us to evaluate the generation speed after each commit.How to test
git clone -b benchmark https://github.com/sukkaw/hexo.git cd hexo npm install ./test/benchmark.sh
Screenshots
Pull request tasks