On 12/15/06 1:28 PM, John Lenton wrote:
> I don't have a 100M text to test with, but I was wondering how changing that 
> to
> 
>   it = (m.group() for m in re.finditer(r'(\S+)', text))
> 
> would compare in both speed and memory?
> (I expect it to use about half as much memory, due to not copying the
> full string, but the speed hit might be too big to make it worthwhile)

Yeah, I tested something like that myself, and decided against it because 
generator expressions aren't available in Python 2.3 and, more importantly, 
because it actually is slightly slower.

Jacob


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to