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

Add @timev, @timed documentation [av skip] #11319

Merged
merged 1 commit into from
May 18, 2015

Conversation

ScottPJones
Copy link
Contributor

This adds documentation for the @timev macro which I added with #11186, as well as documenting the @timed macro, which was already present, but not undocumented.

@tkelman tkelman added the docs This change adds or pertains to documentation label May 18, 2015
@@ -742,7 +742,15 @@ System

.. function:: @time

A macro to execute an expression, printing the time it took to execute and the total number of bytes its execution caused to be allocated, before returning the value of the expression.
A macro to execute an expression, printing the time it took to execute, the number of allocations, the total number of bytes its execution caused to be allocated, before returning the value of the expression.
Copy link
Contributor

Choose a reason for hiding this comment

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

number of allocations, and the total number of bytes

@ScottPJones ScottPJones force-pushed the spj/doctime branch 2 times, most recently from 4fd3dd8 to 6b3198c Compare May 18, 2015 03:49

.. function:: @timev

This is a verbose version of the ``@timev`` macro, it first prints the same information as ``@time``, then any non-zero memory allocation counters, and then returns the value of the expression.
Copy link
Contributor

Choose a reason for hiding this comment

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

missed this - it's not a verbose version of itself, it's a verbose version of @time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Duh! Sorry!

@yuyichao
Copy link
Contributor

IIRC [ci skip] skips both CI's. It worked on one of my PR's #11260. Probably what you really want.

@tkelman
Copy link
Contributor

tkelman commented May 18, 2015

Only if you're really sure you pass make check-whitespace locally. Otherwise still good to have Travis check that. It has happened before that a doc commit that was labeled [ci skip] got merged or pushed, but it had trailing whitespace which then caused later commits/PR's to fail.

@yuyichao
Copy link
Contributor

@tkelman Noted.
I have whitespace mode on in emacs so that should help. Probably doesn't hurt to check anyway though...

tkelman added a commit that referenced this pull request May 18, 2015
@tkelman tkelman merged commit 91c8b9a into JuliaLang:master May 18, 2015
@ScottPJones ScottPJones deleted the spj/doctime branch May 18, 2015 13:20
@yuyichao
Copy link
Contributor

It is probably useful to document the meaning of each line for @timev as well.
Especially since a negetive allocated would be quite confusing (or is it a bug?).

julia> @timev gc()
  18.756 milliseconds (4 allocations: 144 bytes, 99.97% gc time)
elapsed time:    18756225 nanoseconds
gc time:         18749724
bytes allocated: 144
allocated:       -4054608
poolallocs:      4
total allocated: 4054752
pause:           2
full sweep:      1

@ScottPJones
Copy link
Contributor Author

I'll look at it, it is internally stored as an signed int, and you have to add in a collection value... when it is negative, I think it looks in the pool do do allocations...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants