Hello ok,
Monday, September 10, 2007, 6:09:27 AM, you wrote:
>> Locks: getChar has to acquire locks, as does getContents. However,
>> because getContents can operate on blocks, this requires many fewer
>> locks.
> What's to lock against? I'm writing single-threaded code.
unfortunately, there is
Hello Neil,
Monday, September 10, 2007, 3:49:06 AM, you wrote:
>> I'm sure it's true, but it's quite irrelevant to my question, which is
>> "why is using getChar so much slower than using getContents"?
> Buffering, blocks and locks.
in ghc, is entirely due to locking, which is the slowest opera
On 10 Sep 2007, at 11:49 am, Neil Mitchell wrote:
Buffering, blocks and locks.
Buffering: getChar demands to get a character now, which pretty much
means you can't buffer.
Eh what? getchar() in C "demands to get a character now", which is
fully compatible with as much buffering as you want.
On Mon, 2007-09-10 at 00:49 +0100, Neil Mitchell wrote:
> Hi
>
> > > (Some list operations are too expensive with ByteString but for most
> > > string processing it's perfectly fine and much faster than String).
> >
> > I'm sure it's true, but it's quite irrelevant to my question, which is
> > "wh
Hi
> > (Some list operations are too expensive with ByteString but for most
> > string processing it's perfectly fine and much faster than String).
>
> I'm sure it's true, but it's quite irrelevant to my question, which is
> "why is using getChar so much slower than using getContents"?
Buffering,
On 7 Sep 2007, at 11:22 pm, Chaddaï Fouché wrote:
From what I can see of your program, it would greatly benefit from
using Data.ByteString, is there an obvious reason not to use it ?
I am writing a a set of tools to process a legacy programming
language, as I said. Speed is not, in fact, a ce
>From what I can see of your program, it would greatly benefit from
using Data.ByteString, is there an obvious reason not to use it ?
(Some list operations are too expensive with ByteString but for most
string processing it's perfectly fine and much faster than String).
--
Jedaï
_
> I started with the obvious
> main = getContents >>= print . tokenise
> where tokenise maps its way down a list of characters. This is very
> simple, very pleasant, and worked like a charm.
> However, the language has an INCLUDE directive, so I'm going to have
> to call readFile or somethin
I'm writing a tokeniser for a legacy programming language in Haskell.
I started with the obvious
main = getContents >>= print . tokenise
where tokenise maps its way down a list of characters. This is very
simple, very pleasant, and worked like a charm.
However, the language has an INCLUD