Skip to content
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

Speed up length on ARM #614

Merged
merged 1 commit into from
Sep 14, 2024
Merged

Speed up length on ARM #614

merged 1 commit into from
Sep 14, 2024

Conversation

Bodigrim
Copy link
Contributor

Vectorised instructions on ARM are pretty uniform, so I moved the implementation into a self-contained C file. This way all our trickery to detect AVX does not obscure the code.

Benchmarks on my M2 machine:

All
  Pure
    ascii-small
      length
        cons
          Text:     OK
            1.07 μs ± 105 ns, 82% less than baseline
          LazyText: OK
            1.11 μs ± 104 ns, 81% less than baseline
    ascii
      length
        cons
          Text:     OK
            1.31 ms ±  66 μs, 75% less than baseline
          LazyText: OK
            1.35 ms ± 124 μs, 74% less than baseline
    english
      length
        cons
          Text:     OK
            60.7 μs ± 3.9 μs, 82% less than baseline
          LazyText: OK
            64.4 μs ± 4.0 μs, 81% less than baseline
    russian
      length
        cons
          Text:     OK
            190  ns ±  13 ns, 81% less than baseline
          LazyText: OK
            192  ns ±  13 ns, 81% less than baseline
    japanese
      length
        cons
          Text:     OK
            204  ns ±  13 ns, 81% less than baseline
          LazyText: OK
            206  ns ±  13 ns, 81% less than baseline

@Bodigrim Bodigrim requested a review from Lysxia August 28, 2024 20:23
@Lysxia
Copy link
Contributor

Lysxia commented Sep 14, 2024

The netbsd build is broken for unrelated reasons

@Lysxia Lysxia merged commit e4e110e into haskell:master Sep 14, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants