byorgey / haxr

Other
10 stars 16 forks source link

String vs ByteString/Text performance #18

Closed akru closed 7 years ago

akru commented 7 years ago

Some functions use String type as argument for parsing XML-RPC request/response, e.g.

parseCall :: (Show e, MonadError e m) => String -> Err m MethodCall

or

parseResponse :: (Show e, MonadError e m) => String -> Err m MethodResponse

so, may be lazy ByteString type do have best performance for this?

byorgey commented 7 years ago

String and ByteString are not at all interchangeable. But if you replace ByteString with Text you probably have a point. However, I have neither the time nor inclination to make this sort of pervasive change. The haxr codebase is very old (from 2003) and was written (not by me) long before ByteString or Text even existed.

Have you run into any specific performance issues with haxr, or is this just a general observation?

akru commented 7 years ago

I want to use haxr for project but a lot of .toString wrappers not looks good. The legacy code is good explanation of my question, thank you.

What do you think about difficulty of migration? Maybe I can do it.

byorgey commented 7 years ago

I really have no idea. I think it would probably be a lot of work.