-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
@time can't handle top-level-only expressions #5352
Comments
Macro syntax is space sensitive. You can also write The bytes allocated means how many bytes were allocated while evaluating the expression, including code generation. Why would fib need to allocate more than the return value? |
The bytes allocated doesn't distinguish bytes allocated by the user code from bytes allocated during compilation. The 64 bytes in the last case is probably allocation of a couple boxes to shuttle the result to the REPL and such.
|
Is there any way we can turn off the gc_bytes incrementing while doing code gen? |
We probably could, but by the principle of generally preferring transparency the effort might not be worth it. We'd have to go through the code and save the gc counter before every bit we consider off limits, then reset it. You will also get strange results like 0 bytes allocated for code that generates code --- sometimes compilation is logically part of the user program. |
Of course I don't mean 0 bytes literally, just an artificially low number. |
Yeah, it's probably better the way it is. People just need to understand that sometimes running something generates code, which takes up both time and memory. Since we can't avoid the time taken by code generation, it would almost be more confusing to not report the bytes allocated. This way the |
Yes, I think that's exactly how Tim and I felt about it when he first added the bytes counter. |
You can |
Hmmm....is there something we should do for |
This now seems to work: julia> @time using Tokenize
0.014877 seconds (26.78 k allocations: 1.450 MB) |
I don't really care that this doesn't work.
But it could
Also, does anyone think the bytes allocated means something?
Wow. Only 64 bytes allocated that is efficient.
The text was updated successfully, but these errors were encountered: