0
votes

As the title says, I'm using the BS module in Python to parse XML pages that I access from the Amazon API (i create the signed url, load it with liburl2, and then parse with BS).

It takes about 4 seconds to do two pages, but there has to be a faster way

Would PHP be faster? What's making it slow, the BS parsing or the liburl loading?

1
why don't you tell us what makes it slow? I'd bet a dollar it's not the Soup. There is a number of XML processing modules in the standard lib, I don't see why would you need BS here. - SilentGhost
I don't know what's making it slow, that's why I'm asking. Is it the liburl? - Mike J
so, profile it! We're not clairvoyants here. - SilentGhost
Sorry, Ghost, I didn't know about cProfile until Jason suggested it. - Mike J

1 Answers

2
votes

If you want to find out what's making it slow, use one of the profilers. I suspect it's the network access (and their underlying database retrieval) that's slower than the rest.