Re: [web-devel] new field for Network.HTTP.Types.Status

29 Aug
2012
29 Aug
'12
1:21 a.m.
Hello,
I believe unboxing is not possible for ByteString, but it is for the Int field. I don't really know how much performance gains this brings, not really a Haskell performance guru.
I tried this: data Status = Status { statusCode :: {-# UNPACK #-} !Int , statusAsciiCode :: {-# UNPACK #-} !B.ByteString , statusMessage :: {-# UNPACK #-} !B.ByteString } deriving (Show) Since ByteString has just one constructor, UNPACK for ByteString should work according to GHC manual. This results in 41345.3 req/s while no bangs and no UNPACK results in 43098.6. So, let's not add bangs and UNPACKs. Please merge the current pull request. Thanks in advance. --Kazu
4647
Age (days ago)
4647
Last active (days ago)
0 comments
1 participants
participants (1)
-
Kazu Yamamoto