Loading ...
Sorry, an error occurred while loading the content.

Re: "ocaml_beginners"::[] Re: List.append too slow

Expand Messages
  • Mihamina Rakotomandimby
    ... Thank you (Rémi & the other helpers) These are what I decided to retain: http://goo.gl/QR3TM It s 2x faster for this 10 days data, I ll check at the end
    Message 1 of 7 , Dec 6, 2011
    • 0 Attachment
      On 12/01/2011 09:50 PM, Rémi Vanicat wrote:
      > > This is my piece of code: http://goo.gl/mNnTB
      > > As you see, the chart is broken, when the amount of data is "big".
      > > I suspect the List.append to be the problem.
      > > What would be a replacement of List.append?
      > Just build the list in reverse order


      Thank you (Rémi & the other helpers)
      These are what I decided to retain: http://goo.gl/QR3TM

      It's 2x faster for this 10 days data, I'll check at the end of the month
      if it's linear or not.


      Again, thank you.

      --
      RMA.
    • Gabriel Scherer
      With the code you re showing, you first accumulate all the data from your DB in a list, then traverse the list to accumulate a final result. Maybe you could
      Message 2 of 7 , Dec 7, 2011
      • 0 Attachment
        With the code you're showing, you first accumulate all the data from your
        DB in a list, then traverse the list to accumulate a final result. Maybe
        you could compute the final result incrementally in the DB callback,
        without accumulating any data, only the partial result. You would have
        constant memory usage, instead of linear.

        On Wed, Dec 7, 2011 at 7:27 AM, Mihamina Rakotomandimby
        <mihamina@...>wrote:

        > On 12/01/2011 09:50 PM, Rémi Vanicat wrote:
        > > > This is my piece of code: http://goo.gl/mNnTB
        > > > As you see, the chart is broken, when the amount of data is "big".
        > > > I suspect the List.append to be the problem.
        > > > What would be a replacement of List.append?
        > > Just build the list in reverse order
        >
        >
        > Thank you (Rémi & the other helpers)
        > These are what I decided to retain: http://goo.gl/QR3TM
        >
        > It's 2x faster for this 10 days data, I'll check at the end of the month
        > if it's linear or not.
        >
        >
        > Again, thank you.
        >
        > --
        > RMA.
        >
        >
        > ------------------------------------
        >
        > Archives up to December 31, 2010 are also downloadable at
        > http://www.connettivo.net/cntprojects/ocaml_beginners
        > The archives of the very official ocaml list (the seniors' one) can be
        > found at http://caml.inria.fr
        > Attachments are banned and you're asked to be polite, avoid flames
        > etc.Yahoo! Groups Links
        >
        >
        >
        >


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.