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

Use unlifted Array# for TArray #66

Merged
merged 2 commits into from Oct 5, 2023
Merged

Conversation

konsumlamm
Copy link
Contributor

@konsumlamm konsumlamm commented Sep 6, 2023

Closes #13.

I copied the code for Array for the most part. The new newArray doesn't separate the construction of the TVar#s and the construction of the Array# (unlike the old version), I'm not sure if that's a problem.

The benchmarks show that TBQueue gets a bit faster with this change.

Benchmark results
All
  concurrent spsc
    Chan:               OK (0.95s)
      317  ms ± 7.5 ms
    TChan:              OK (2.85s)
      189  ms ±  15 ms
    TQueue:             OK (34.34s)
      127  ms ± 9.7 ms
    TBQueue (unlifted): OK (0.48s)
      160  ms ±  15 ms
    TBQueue:            OK (0.62s)
      206  ms ±  19 ms
  concurrent mpmc
    Chan:               OK (35.09s)
      11.698 s ±  19 ms
    TChan:              OK (5.04s)
      734  ms ±  30 ms
    TQueue:             OK (1.63s)
      545  ms ±  45 ms
    TBQueue (unlifted): OK (17.37s)
      1.190 s ±  26 ms
    TBQueue:            OK (3.93s)
      1.300 s ± 123 ms
  bulk
    Chan:               OK (6.68s)
      443  ms ±  23 ms
    TChan:              OK (3.25s)
      462  ms ±  19 ms
    TQueue:             OK (1.00s)
      336  ms ±  19 ms
  burst
    Chan:               OK (2.92s)
      206  ms ±  18 ms
    TChan:              OK (3.50s)
      238  ms ±  11 ms
    TQueue:             OK (0.52s)
      177  ms ± 7.1 ms
    TBQueue (unlifted): OK (0.77s)
      257  ms ±  13 ms
    TBQueue:            OK (0.78s)
      263  ms ± 4.2 ms

@bgamari
Copy link
Contributor

bgamari commented Sep 22, 2023

Can you add entries to the CHANGELOG describing this and your previous changes?

@bgamari bgamari merged commit e758017 into haskell:master Oct 5, 2023
15 checks passed
@konsumlamm konsumlamm deleted the unbox-tarray branch October 5, 2023 21:30
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.

Unbox TArray
2 participants