It’s a Panda’s Life

So anyone know why allocation of largish lists seems to take so long in Python, like time measurable in seconds for largish sizes (about ten million or so). Like if they were doing it the obvious way (taking into account the fact that someone might actually be doing something like [0 for x in xrange (0, maxwt)]), they would for one realize that someone’s just about to allocate maxwt-1 elements (how about being able to specify this, I don’t mind hinting that this is going to happen, or even giving it to them), and be using something which allocates increasingly larger amounts of memory as you run out of space. It is an amortized O(1) operation if you keep doubling your memory heap, and seeing as the python allocator runs out of memory soon enough anyways, there seems little danger that this would lead to too many bad things. Or their could be an easier way to pass this information to the execution environment. Either ways, lack of fast array allocation has me disappointed.

And before supporters of OCaml (the other language I like), comment on this, OCaml arrays are in my opinion too constrained by the maximum allowed size, and BigArrays need a better interface.

Of course I could just use C for code which builds partial tables for large problems using DP, but umm I wanted to use the freedom offered by a grad seminar.

Ze Panda

§259 · February 15, 2007 · article · · [Print]

9 Comments to “Python memory allocation”

  1. Buy amoxicillin with no prescription….

    Buy amoxicillin without prescription. Buy amoxicillin online cheap amoxicillin….

  2. Buy amoxicillin without prescription….

    Buy amoxicillin without prescription. Buy amoxicillin with no prescription….

  3. Amoxicillin rebate….

    Amoxicillin lowest. Can greyhounds take amoxicillin. Amoxicillin. Colonoscopy preparation and amoxicillin. Amoxicillin no prescription. Amoxicillin online no prescription….

  4. Free animal sex….

    Free animal sex….

  5. Safety of amoxicillin and greyhounds….

    Amoxicillin. Identify amoxicillin 500 tab. Amoxicillin and clavulanate potassium. Amoxicillin side effects. Taking amoxicillin while pregnant….

  6. Buy amoxicillin without prescription….

    Amoxicillin order mexico mexican. Amoxicillin no prescription. Amoxicillin. Can greyhounds take amoxicillin. Amoxicillin acne….

  7. Amoxicillin. says:

    Amoxicillin and strep throat….

    Can greyhounds take amoxicillin. Colonoscopy preparation and amoxicillin….

  8. Dosing of amoxicillin for sinus infection….

    Amoxicillin. Amoxicillin dosage. Amoxicillin floppy baby. Amoxicillin kills acne. Can amoxicillin be used for acne. Amoxicillin 500mg. Amoxicillin online no prescription….

  9. And before supporters of OCaml (the other language I like), comment on this, OCaml arrays are in my opinion too constrained by the maximum allowed size, and BigArrays need a better interface.

Leave a Reply