Why is it so slow?

1 view
Skip to first unread message

max.p...@t-online.de

unread,
Sep 25, 2009, 2:11:05 PM9/25/09
to webl...@googlegroups.com
Hello folks,

I'm new to lisp in general and started a bit learning-by-doing by experimenting with weblocks.  Now I got a question of which Im sure it actually got an modest answer. At least in the simple-blog example I notice the viewing and scrolling for both Firefox and Opera to be kind of consuming, especially in Opera. Very unlike the thanandar site for example which seems to be viewed perfectly smooth to me. Thus I guess it's not generous weblocks behaviour. So: what am I doing wrong?

Thanks

Leslie P. Polzer

unread,
Sep 25, 2009, 2:19:01 PM9/25/09
to weblocks
Hi,

can you describe in more detail the problems you experience?

Do you experience the same when using the demo application?

Leslie

max.p...@t-online.de

unread,
Sep 25, 2009, 3:55:10 PM9/25/09
to webl...@googlegroups.com
Dear Leslie,

the problem actually is just: scrolling in the simple-blog app, for me, slows down the browser, it seems to consume much of the browsers resources. especially in opera.
And yes, I experience this with the weblocks-demo-app too. Whereas the thanandar site is perfectly smooth.

Regards

Leslie P. Polzer

unread,
Sep 26, 2009, 4:10:53 AM9/26/09
to weblocks
On Sep 25, 9:55 pm, "max.powe...@t-online.de" <max.powe...@t-
I've never experienced anything like this. Thanandar is much more
complicated
than any of the demo applications, the only difference is that it runs
an older
version of Weblocks.

This sounds like a browser or system problem to me...

max.p...@t-online.de

unread,
Sep 29, 2009, 1:02:21 PM9/29/09
to webl...@googlegroups.com
This hasnt showed up yet so I post it a second time. Hope you don't mind.

-----------------------------------------------
Dear Leslie,

I made an observation, two things make it run smooth for me:
Removing the content from main.css (replaced it with own css code) , or hitting the "Add" button of a grid-edit table; when the corresponding form view opens, it suddenly runs smooth too.

however, thanks for your answers.

I already got another question. I tried to make the navigation driven by the URL with a selector as described here
http://teddyb.org/rlp/tiki-index.php?page=Learning+About+Weblocks

  "(make-instance
    'selector
    :panes (list
        (cons "users" (make-users-page))
        (cons "clients" (make-clients-page))))"

So my own code looks like this

"(defun init-user-session (comp)
  (setf (composite-widgets comp)
    (make-main-page)))

(defun make-main-page()
      (make-instance
           'selector
           :panes (list
               (cons "blog" (make-blog-widget))
               (cons "admin" (make-admin-page)))))"

Now if I try to access /blog it tells me:
"SIMPLE-ERROR: There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION WEBLOCKS:GET-WIDGET-FOR-TOKENS (2)>  when called with arguments (#<WEBLOCKS:SELECTOR "dom3"> #<WEBLOCKS:URI-TOKENS (admin)>)."


Further, if I try to use a selector instead as described in the same tutorial like this

"(defun make-main-page ()
  (make-instance
  'dispatcher
  :on-dispatch (lambda (widget url-bits)
        (declare (ignore widget))
        (cond
         ((string= (first url-bits) "blog")
            (make-blog-widget))
         ((string= (first url-bits) "admin")
            (make-admin-page))
         ((not url-bits)
            (make-blog-widget))))))"

it will tell me, there were no dispatcher-class.


Thank you in advance.

max.p...@t-online.de

unread,
Sep 28, 2009, 8:07:06 AM9/28/09
to webl...@googlegroups.com

Leslie P. Polzer

unread,
Oct 1, 2009, 3:18:41 AM10/1/09
to weblocks
On Sep 28, 2:07 pm, "max.powe...@t-online.de" <max.powe...@t-
online.de> wrote:
> Dear Leslie,
> I made an observation, two things make it run smooth for me:
> Removing the content from main.css (replaced it with own css code) , or hitting the "Add" button of a grid-edit table; when the corresponding form view opens, it suddenly runs smooth too.

Looks like a problem in the mentioned browsers' CSS engine. Odd that I
don't experience
that. Can you narrow it down to a specific CSS rule in the file?


> it will tell me, there were no dispatcher-class.

There is no longer, but the new system is pretty similar.
You need to inherit from SELECTOR and specialize GET-WIDGET-FOR-
TOKENS.

Read the documentation for this function (or all the docstrings in src/
widgets/selector.lisp)
to get more information.

Does that help you?

Leslie

max.p...@t-online.de

unread,
Oct 1, 2009, 10:42:16 AM10/1/09
to webl...@googlegroups.com
Dear Leslie,

why can't I use static-selector? It already has an get-widget-for-tokens implementation.

Regards

Leslie P. Polzer

unread,
Oct 1, 2009, 11:47:54 AM10/1/09
to weblocks
On Oct 1, 4:42 pm, "max.powe...@t-online.de" <max.powe...@t-online.de>
wrote:
> Dear Leslie,
> why can't I use static-selector? It already has an get-widget-for-tokens implementation.
> Regards

It depends on what you're trying to do. If your selector will have
some kind of mapping
from tokens to panes instead of or next to some other mechanism (like
relying on the time
of day and similar things) you're probably better off with inheriting
from static-selector.

Leslie

max.p...@t-online.de

unread,
Oct 1, 2009, 11:58:39 AM10/1/09
to webl...@googlegroups.com
Dear Leslie,

I don't want to to fancy stuff here. All I want is a navigation without the visible menu. But when I use static-selector, all that is being rendered is a page-layout without content.

(defun make-main-page ()
    (make-instance
    'static-selector
    :panes (list
        (cons "blog" (make-blog-widget)))))

Regards

Leslie P. Polzer

unread,
Oct 1, 2009, 12:23:57 PM10/1/09
to weblocks
On Oct 1, 5:58 pm, "max.powe...@t-online.de" <max.powe...@t-online.de>
wrote:
> Dear Leslie,
> I don't want to to fancy stuff here. All I want is a navigation without the visible menu.

Oh, that's simple. Just inherit from navigation and specialize render-
navigation-menu
to do nothing.


> But when I use static-selector, all that is being rendered is a page-layout
> without content.

Yes, a selector doesn't display anything by itself. The navigation
widget
adds the things you can see (menu and content).

Leslie

max.p...@t-online.de

unread,
Oct 1, 2009, 1:21:26 PM10/1/09
to webl...@googlegroups.com
>> But when I use static-selector, all that is being rendered is a page-layout
>> without content.

>Yes, a selector doesn't display anything by itself. The navigation
>widget
>adds the things you can see (menu and content).

Well, I meant it doesn't seem to display make-blog-widget :-)
Shouldn't it do that with


(defun make-main-page ()
    (make-instance
    'static-selector
    :panes (list
        (cons "blog" (make-blog-widget)))))

??

Regards

Leslie P. Polzer

unread,
Oct 1, 2009, 1:28:50 PM10/1/09
to weblocks
On Oct 1, 7:21 pm, "max.powe...@t-online.de" <max.powe...@t-online.de>
wrote:
No, the (static-)selector class' sole responsibility is routing to
widgets, it doesn't display anything.

max.p...@t-online.de

unread,
Oct 1, 2009, 1:51:25 PM10/1/09
to webl...@googlegroups.com
ok break. i think weve got our wires crossed. so from scratch:
make-blog-widget creates the widget i want to display to the user under
the url /blog, same thing with make-admin-page (under /admin). without a
menu. static-selector now is not what servers this task?

Regards


Leslie P. Polzer

unread,
Oct 1, 2009, 1:59:14 PM10/1/09
to weblocks
No. As I've stated in one of my messages today you need to inherit
from navigation and specialize render-navigation-menu.

Did you miss that part?

Leslie
Reply all
Reply to author
Forward
0 new messages