Skip to content

Possibly interesting features of Julia v1.8 #1075

@ranocha

Description

@ranocha

From https://github.com/JuliaLang/julia/blob/v1.8.0-beta1/NEWS.md:

  • Mutable struct fields may now be annotated as const to prevent changing them after construction, providing for greater clarity and optimization ability of these objects (#43305).

    May be interesting for stuff like MHD

  • Type annotations can now be added to global variables to make accessing them type stable (#43671).

    May be interesting to avoid global constants using Refs.

  • @inline and @noinline annotations can now be applied to a function call site or block to enforce the involved function calls to be (or not to be) inlined (#41312).

    See Think about callsite inlining when it's shipped officially #836

  • Base.ifelse is now defined as a generic function rather than a builtin one, allowing packages to extend its definition (#37343).

    Should allow us to get rid of our dependency IfElse.jl, see Remove IfElse.jl dependency #2255.

  • Inference now tracks various effects such as side-effectful-ness and nothrow-ness on a per-specialization basis. Code heavily dependent on constant propagation should see significant compile-time performance improvements and certain cases (e.g. calls to uninlinable functions that are nevertheless effect free) should see runtime performance improvements. Effects may be overwritten manually with the @Base.assume_effects macro (#43852).

  • The LazyString and the lazy"str" macro were added to support delayed construction of error messages in error paths (#33711).

  • New macro @time_imports for reporting any time spent importing packages and their dependencies (#41612).

    Mostly for development

  • The standard library LinearAlgebra.jl is now completely independent of SparseArrays.jl, both in terms of the source code as well as unit testing (#43127). As a consequence, sparse arrays are no longer (silently) returned by methods from LinearAlgebra applied to Base or LinearAlgebra objects. Specifically, this results in the following breaking changes
    ...
    New sparse concatenation functions sparse_hcat, sparse_vcat, and sparse_hvcat return SparseMatrixCSC output independent from the types of the input arguments. They make concatenation behavior available, in which the presence of some special "sparse" matrix argument resulted in sparse output by multiple dispatch. This is no longer possible after making LinearAlgebra.jl independent from SparseArrays.jl (#43127).

    We should check whether we rely on this changed behavior somewhere (DGMulti, I'm looking at you)

  • CPU profiling now records sample metadata including thread and task. Profile.print() has a new groupby kwarg that allows grouping by thread, task, or nested thread/task, task/thread, and threads and tasks kwargs to allow filtering. Further, percent utilization is now reported as a total or per-thread, based on whether the thread is idle or not at each sample. Profile.fetch() includes the new metadata by default. For backwards compatibility with external profiling data consumers, it can be excluded by passing include_meta=false (#41742).

    Should be helpful for investigating multithreaded performance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions