[web-devel] new field for Network.HTTP.Types.Status
Kazu Yamamoto ( 山本和彦 )
kazu at iij.ad.jp
Tue Aug 28 06:19:58 CEST 2012
Hello,
Sorry for the delay. I compared several approaches:
Original (divMod): 40,280.7 req/s
Hard coded literal ("200"): 43,888.6 req/s
Array: 41,566.2 req/s
A new field: 43,098.6 req/s
This result makes sense to me. Since the new field is remarkably
faster than the array. I would like to take this approach.
If Aristid agree, I will send a pull request. My modification is here:
https://github.com/kazu-yamamoto/http-types/commit/e8c2cf2672318e9f32ad3aafbcfa000efd146d66
--Kazu
> Hi,
>
>>> So, I redefined Network.HTTP.Types.Status to have reformatted
>>> ByteString for status code (the statusAsciiCode field):
>>> https://github.com/kazu-yamamoto/http-types/blob/status-ascii-code/Network/HTTP/Types/Status.hs
>>
>> It seems like this could be solved with a lookup table. If this change is
>> made I think it would need to make sense to hide the Status constructor and
>> use a smart constructor or similar.
>
> Thank you for taking time. I implemented an array some days ago:
>
> https://github.com/kazu-yamamoto/http-types/blob/status-array/Network/HTTP/Types/StatusArray.hs
>
> But it appeared that this week is too busy to test it. I will come
> back this issue in the next week. Sorry for the delay.
>
> --Kazu
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
More information about the web-devel
mailing list