Git Product home page Git Product logo

Comments (11)

idlesign avatar idlesign commented on June 9, 2024

Please describe, how do you get those numbers: are they averages, do you use cache, was it a "cold" start, was it a full-menu or partial rendering, do you use access rights checks, Django version.

It might have been expected for recursive template inclusions (what sitetree does), yet your tree is not so big, and far from being deeply nested.

from django-sitetree.

vosi avatar vosi commented on June 9, 2024

using ab on home page, they are average (на глаз после 10ка прогонов :)
yes, i do use cache (memcached)
i dont count cold start
it is a full menu
no acces rights
django 1.4 latest trunk (btw, the same with 1.3.1)

from django-sitetree.

idlesign avatar idlesign commented on June 9, 2024

I'd be glad to see the dump of that tree, if it's not a secret %) so that we can try to cope with the issue.

from django-sitetree.

vosi avatar vosi commented on June 9, 2024

http://ubuntuone.com/22Vccc0HXLr29wBRZXarhA

from django-sitetree.

idlesign avatar idlesign commented on June 9, 2024

I cannot achieve your numbers with {% sitetree_menu from "main" include "trunk" %} on Django dev server. Do you use custom template or different tag instruction? What web-server software do you use?

Please benchmark the following template:

{% load sitetree %}

{% sitetree_menu from "main" include "trunk" %}

from django-sitetree.

vosi avatar vosi commented on June 9, 2024

~300 ms (DEBUG* = False, manage.py runserver)
code for view

    class Main(TemplateView):
    template_name = 'imxo.html'

imxo.html

{% load sitetree %}
<html>
<head></head>
<body>{% sitetree_menu from "main" include "trunk" %}</body>
</html>

vs

{% sitetree_menu from "header" include "trunk" %}

~15 ms

from django-sitetree.

dbrgn avatar dbrgn commented on June 9, 2024

I don't know much about the implementation details, but maybe https://github.com/django-mptt/django-mptt/ would help? It could also simplify the codebase.

from django-sitetree.

idlesign avatar idlesign commented on June 9, 2024

This issue cannot be solved by mptt. Sitetree operates a full tree structure in memory, so mptt could not simplify sitretree's codebase (it is simple enought already %)), eventually adding a dependency.

This issue is about semi-idle tree traversing cycles on each tree level, and that is what should be fixed/optimized.

from django-sitetree.

dbrgn avatar dbrgn commented on June 9, 2024

Ah, ok :)

from django-sitetree.

idlesign avatar idlesign commented on June 9, 2024

@vosi With 1.0. template variable in URL feature will be removed, that should speed up sitetree a little. Other speed impovements yet to go %)

from django-sitetree.

idlesign avatar idlesign commented on June 9, 2024

Notes on performance in documentation seems the appropriate solution for now.
I should add some. Feel free to reopen, if they won't fit your case.

from django-sitetree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.