[Tutor] Trying to parse a HUGE(1gb) xml file in python

David Hutto smokefloat at gmail.com
Tue Dec 21 10:46:13 CET 2010


On Tue, Dec 21, 2010 at 4:34 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> David Hutto, 21.12.2010 10:19:
>>
>> On Tue, Dec 21, 2010 at 4:17 AM, David Hutto wrote:
>>>
>>> On Tue, Dec 21, 2010 at 4:10 AM, Stefan Behnel wrote:
>>>>>>
>>>>>> Note that it's not unlikely that this is actually *slower* than using
>>>>>> a
>>>>>> real XML parser:
>>>>>
>>>>> Or a 'real' language like C or C++ maybe to increase, or in Python's
>>>>> case, bypass, the interpreter?
>>>>
>>>> While this may be a little faster than Python code (although I suspect
>>>> that
>>>> benchmarking is needed to prove either way), I doubt that it's worth the
>>>> overhead in code writing. If I can write a couple of lines of Python
>>>> code
>>>> that are easy to validate and almost as fast as C code, why would I want
>>>> to
>>>> write and debug hundreds of lines of code in C or C++, just to see that
>>>> I
>>>> need to tune my benchmark to notice the difference?
>>>
>>> Don't get me wrong, I love the simplicity too, but if you know you
>>> really do need it along the way, then you should start thinking ahead
>>> of the easy, and toward the harder code for your project. Just as
>>> every language has it's place, so does Python.
>
> Premature optimisation is the root of all evil. That totally applies when
> choosing a programming language.


Not premature design, but being pre mature when selecting. Do you
utilize python for aviation? you could, but modeling would be better.
However, you'll just have to learn another language in order to
optimize the end means.

I know python has it's own optimizations, but it's still interpreting
to the command line. A dog fight between two f-15's would certainly
notice the response rate when pulling out of a intersect course.

>
>
>> If I want to write a programming language, It might not be the best
>> idea to have a labguage needed for speed based on Python, I should
>> maybe use wha it's based on, or refine my own optimizations, just to
>> be a little clearer about my perspective.
>
> Being clearer would certainly help in understanding your postings.

What's the difference between a language based on C++ Python, and C?

If I used any of the above to begin writing my own language, which of
the above would be faster(other languages aside) to begin with?


More information about the Tutor mailing list