github kamadorueda/alejandra 0.7.0

latest releases: 3.0.0, 2.0.0, 1.5.0...
2 years ago

Added

  • Inline comments support in binary operators:
    -      ++
    -      # subsections go last
    +      ++ # subsections go last
  • Inline comments support in with and assert expressions:
    -  assert (libXft != null) -> libpng != null;
    -  # probably a bug
    -  assert stdenv.isDarwin -> libXaw != null;
    -  # fails to link otherwise
    +  assert (libXft != null) -> libpng != null; # probably a bug
    +
    +  assert stdenv.isDarwin -> libXaw != null; # fails to link otherwise
    +
  • Inline comments support for if-then-else expressions:
                    if y ? ${a}
    -                then v x.${a} y.${a}
    -                # both have attr, use merge func
    -                else x.${a}
    -              # only x has attr
    +                then v x.${a} y.${a} # both have attr, use merge func
    +                else x.${a} # only x has attr
  • Inline comments support for inherit expressions:
        inherit
          (callPackage ../development/tools/ocaml/ocamlformat {})
    -      ocamlformat
    -      # latest version
    +      ocamlformat # latest version
           ocamlformat_0_11_0
  • Inline comments support for parenthesis expressions:
    -        || (
    -          # Accept {} for tests that are unsupported
    +        || ( # Accept {} for tests that are unsupported
              isDerivation x
              && x ? meta.timeout
            );

Changed

  • Linux binaries now use mimalloc
    to provide much better performance when formatting Nixpkgs:

    • x86_64-unknown-linux-gnu, 1.3x faster,
      from 0m10.639s to 0m8.381s

    • x86_64-unknown-linux-musl, 15.8x faster,
      from 2m32.686s to 0m9.642s

    • On QEMU aarch64-unknown-linux-musl,
      4.6x faster,
      from 5m26s to 1m10s

    • On QEMU armv6l-unknown-linux-musleabihf,
      1.05x faster,
      from 8m7s to 7m41s

    • On QEMU armv7l-unknown-linux-musleabihf,
      1.15x faster,
      from 5m54s to 5m7s

    • On QEMU i686-unknown-linux-musl,
      1.07x faster,
      from 2m44s to 2m33s

  • After profiling the code as suggested by
    nnethercote's perf-book
    one critical path of Alejandra was identified an optimized,
    yielding huge performance boosts:

    • x86_64-unknown-linux-gnu, 2.5x faster,
      from 0m8.381s to 0m3.410s

    • x86_64-unknown-linux-musl, 2.3x faster,
      from 0m9.642s to 0m4.134s

    • On QEMU aarch64-unknown-linux-musl,
      2.4x faster,
      from 1m10s to 0m29s

    • On QEMU armv6l-unknown-linux-musleabihf,
      1.85x faster,
      from 7m41s to 4m8.399s

    • On QEMU armv7l-unknown-linux-musleabihf,
      1.88x faster,
      from 5m7s to 2m42.595s

    • On QEMU i686-unknown-linux-musl,
      1.65x faster,
      from 2m33s to 1m32.671s

    In general this is an algorithmic improvement
    and therefore the following platforms should be faster as well
    by a similar ratio
    (not measured):

    • aarch64-apple-darwin
    • x86_64-apple-darwin
  • A --threads flag, so you can pick how many formatting threads to spawn.
    Defaults to the number of logical CPUs in your system.

  • Position counters were improved to offer an extra 1.13x speedup.

What's Changed

Full Changelog: 0.6.0...0.7.0

Don't miss a new alejandra release

NewReleases is sending notifications on new releases.