traversal or url dispatch faster?

93 views
Skip to first unread message

Iain Duncan

unread,
Oct 10, 2013, 1:51:20 PM10/10/13
to pylons-...@googlegroups.com
I'm making a lightweight service that needs to execute as fast as possible, is there a performance difference in using traversal vs url dispatch?

thanks!
Iain

Cliff Kachinske

unread,
Oct 15, 2013, 9:51:39 AM10/15/13
to pylons-...@googlegroups.com
How big is a fish?

Usually, interaction with the persistent datastore is the main factor in web app performance, unless your code does some really terrible things.

Getting a connection takes the longest, so you want connection pooling.

After that your indexing scheme has to be right.  Too many indexes and your inserts and updates become slow. Not enough indexes and your selects become slow.

Cached data and/or cached pages are the fastest.

If I understand the Fine Pyramid Manual, traversal means using Zope while url dispatch means using a relational db. A little research might give you some insight into the relative performance of the two.

Get the code working first, then worry about performance.

Paul Winkler

unread,
Oct 21, 2013, 2:43:33 PM10/21/13
to pylons-...@googlegroups.com
Traversal does not mean Zope at all. Traversal means using literally any data you like that you can model as a tree of resources.

Likewise, URL dispatch has nothing to do with relational databases per se.  It just means mapping URI regular expressions to view code.

Otherwise, I agree with your comments.  Performance of traversal vs. URL displatch would be one of the last things I would ever worry about.

The one caveat I know of is that traversal could have performance implications if your data store requires a separate hit for each node of the tree that you traverse, because that would mean that  resources deeper into the tree would be slower to access.

Paul Everitt

unread,
Oct 21, 2013, 2:47:41 PM10/21/13
to pylons-...@googlegroups.com
On 10/15/13 9:51 AM, Cliff Kachinske wrote:
> How big is a fish?
>
> Usually, interaction with the persistent datastore is the main factor in
> web app performance, unless your code does some really terrible things.
>
> Getting a connection takes the longest, so you want connection pooling.
>
> After that your indexing scheme has to be right. Too many indexes and your
> inserts and updates become slow. Not enough indexes and your selects become
> slow.
>
> Cached data and/or cached pages are the fastest.
>
> If I understand the Fine Pyramid Manual, traversal means using Zope while
> url dispatch means using a relational db. A little research might give you
> some insight into the relative performance of the two.

Traversal doesn't have to mean using the ZODB. You can do things in
memory, with XML or YAML, or even with a relational database. I've been
plodding along on a Quick Tutorial for Traversal that shows how:


http://docs.pylonsproject.org/projects/pyramid_tutorials/en/latest/quick_traversal/

--Paul
Reply all
Reply to author
Forward
0 new messages