-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# NEWS.md | ||
|
||
This file contains information about major updates since 1.0. | ||
|
||
## Version 1.1 | ||
|
||
This version implements major changes in how `parcel` works on the output of `@snoopi`: | ||
|
||
- keyword-supplying methods are now looked up as `Core.kwftype(f)` rather than by | ||
the gensymmed name (`var"#f##kw"` or `getfield(Base, Symbol("#kw##sum"))`) | ||
- On Julia 1.4+, SnoopCompile will write precompile directives for keyword-body functions | ||
(sometimes called the "implementation" function) that look them up by an algorithm that | ||
doesn't depend on the gensymmed name. For example, | ||
```julia | ||
let fbody = try __lookup_kwbody__(which(printstyled, (String,Vararg{String,N} where N,))) catch missing end | ||
if !ismissing(fbody) | ||
precompile(fbody, (Bool,Symbol,typeof(printstyled),String,Vararg{String,N} where N,)) | ||
end | ||
end | ||
``` | ||
For files that have precompile statements for keyword-body functions, the `__lookup_kwbody__` | ||
method is defined at the top of the file generated by `SnoopCompile.write`. | ||
- Function generators are looked up in a gensym-invariant manner with statements like | ||
```julia | ||
precompile(Tuple{typeof(which(FuncKinds.gen2,(Int64,Any,)).generator.gen),Any,Any,Any}) | ||
``` | ||
- Anonymous functions and inner functions are looked up inside an `isdefined` check, to | ||
prevent errors when the precompile file is used on a different version of Julia with | ||
different gensym numbering. | ||
|
||
Other changes: | ||
- A convenience utility, `timesum`, was introduced (credit to aminya) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "SnoopCompile" | ||
uuid = "aa65fe97-06da-5843-b5b1-d5d13cad87d2" | ||
author = ["Tim Holy <[email protected]>"] | ||
version = "1.0.2" | ||
version = "1.1.0" | ||
|
||
[deps] | ||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | ||
|