Skip to content

Commit

Permalink
Add NEWS.md and tag as 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Dec 7, 2019
1 parent b5e1f53 commit da364da
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions NEWS.md
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)
2 changes: 1 addition & 1 deletion Project.toml
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"
Expand Down

0 comments on commit da364da

Please sign in to comment.