-
Notifications
You must be signed in to change notification settings - Fork 141
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
Expand ShortByteStrings API? #83
Comments
I/O functions that may block (and therefore are marked |
Even at a time when the STUArray is frozen and has left the ST monad? |
@hce I think I might but it's not going to be easy, since |
What I need the mutable array for is the deflate algorithm that I'm implementing. I'm open to alternative suggestions for how to best implement this. :) It is not the only bottleneck, but the conversion does appear to take a non-negligible amount of time. Do you think "converting" the individual Word8 values to a Builder would be more efficient than the memcpy of ShortByteString into ByteString? |
No, a memcpy is as fast as it gets. Using a builder is also copying, just slower. |
So, I have to say I'm back in a state of confusion. I'm not really clear what you're doing, or what you think would make things faster. We should have some clear statement of a problem and a plausible looking solution before anyone implements anything here. |
I propose doing the opposite: adding processing functions to One problem is the combinators explosion, a possible way i can think of is to use |
I'm afraid that expanding |
I created: https://github.com/hasufell/shortbytestring It's also on hackage: https://hackage.haskell.org/package/shortbytestring Reviews welcome. It is currently used in the abstract-filepath library, which is WIP and will heavily rely on it. |
I'm using ShortByteStrings to convert from (STUArray Int Word8). Having hPut available would save the memory allocation and memcpy that happens when converting a ShortByteString into a ByteString.
Would you accept a patch that adds this function to ShortByteStrings?
The text was updated successfully, but these errors were encountered: