Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
I would like a clarification about Enumerators and Iteratees, please :)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alfredo Di Napoli  
View profile  
 More options Oct 16 2012, 8:47 am
From: Alfredo Di Napoli <alfredo.dinap...@gmail.com>
Date: Tue, 16 Oct 2012 14:46:00 +0200
Subject: [Haskell-cafe] I would like a clarification about Enumerators and Iteratees, please :)

Hi guys,

I've started playing with Iteratee and Enumerators: very cool and addictive
stuff.

I have wrote this simple code:

https://gist.github.com/3899017

In a nutshell, it gives back the number of occurences for a single char in
case the argument passed from the command line is a single char,
or the number of lines of the entire file.

I've tried it first on a small file (~100MB) and then on a huge one (~3GB).
As far as I understood Iteratee IO should be a smart way to do IO,
avoiding to keep the entire file in memory; what I observe in the second
case, instead, is a sort of memory leak. The memory grows and grows
until the entire machine hangs.

If I split the huge file in "small" chunks, memory comsumption is still
high but the computation terminates and is fast.

So my two questions:

a) What am I missing? Should be memory used be constant? And how can I
achieve this purpose?
b) I'm using the package enumerator because as far as I can see is the most
used. How does it compares with "iteratee"? Which of the two are more
performant?

Bye and thanks,
A.

_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory Collins  
View profile  
 More options Oct 16 2012, 8:54 am
From: Gregory Collins <g...@gregorycollins.net>
Date: Tue, 16 Oct 2012 14:53:34 +0200
Local: Tues, Oct 16 2012 8:53 am
Subject: Re: [Haskell-cafe] I would like a clarification about Enumerators and Iteratees, please :)

You have a space leak in "countCharBS". Put a bang pattern on your
accumulator.

On Tue, Oct 16, 2012 at 2:46 PM, Alfredo Di Napoli <

--
Gregory Collins <g...@gregorycollins.net>

_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »