Abdelrazak Younes wrote:
Peter Kümmel wrote:
Joost Verburg wrote:
Peter Kümmel wrote:
Here a line from the scons log:

cl /nologo /TP /EHsc /wd4819 /wd4996 -DHAVE_CONFIG_H
-DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -DQT_NO_STL
-DQT3_SUPPORT /IC:\Programme\zlib\include

no optimization is enabled, but it links against the
release Qt4 libs: QtCore4.lib QtGui4.lib.
I did enable all optimizations using CCFLAGS. With LyX 1.4 and Q../Free
I can scroll the whole Users Guide in 10 seconds, with LyX 1.5 and Qt4
it takes 30 seconds.

Oh, now I understand, that's a difference between Qt3 and Qt4.
From 10s to 30s that's really bad for on "upgrade".

I've said it multiple time but in case you didn't know, part of that slowness is due to the fact that Key buffering is disabled in qt4.

And I was wrong multiple times!

I am applying this patch to my branch that will enable conditionally the keyboard buffering with the USE_KEY_BUFFERING macro.

For me it is slower with (43 seconds) than without (37 seconds).

That does not explain it all though and Qt4 is definitely slower than Qt3.

So the slowness is due in part to my coding and but of course also to Qt4...

Abdel.

Index: WorkArea.C
===================================================================
--- WorkArea.C  (revision 14026)
+++ WorkArea.C  (working copy)
@@ -38,6 +38,11 @@
 
 #include <boost/bind.hpp>
 
+// Abdel (09/06/2006):
+// I want the drawing to be fast without Keyboard buffering so when working
+// on optimization, please set the following macro to 0:
+#define USE_KEY_BUFFERING 0
+
 using std::endl;
 using std::string;
 
@@ -150,18 +155,18 @@
                << "\n viewport height\t" << viewport()->height()
                << endl;
 
-/*
-       // This is the keyboard buffering stuff...
-       // I don't see any need for this under windows. The keyboard is reactive
-    // enough...
+       if (USE_KEY_BUFFERING) {
+               // This is the keyboard buffering stuff...
+               // I don't see any need for this under windows. The keyboard is 
reactive
+               // enough...
 
-       if ( !QObject::connect(&step_timer_, SIGNAL(timeout()),
-               this, SLOT(keyeventTimeout())) )
+               if ( !QObject::connect(&step_timer_, SIGNAL(timeout()),
+                       this, SLOT(keyeventTimeout())) )
                        lyxerr[Debug::GUI] << "ERROR: keyeventTimeout cannot 
connect!" << endl;
 
-       // Start the timer, one-shot.
-       step_timer_.start(50, true);
-*/
+               // Start the timer, one-shot.
+               step_timer_.start(50, true);
+       }
 
        ///////////////////////////////////////////////////////////////////////
        // Specific stuff goes here...
@@ -357,15 +362,17 @@
                << " key=" << e->key()
                << endl;
 
-//     keyeventQueue_.push(boost::shared_ptr<QKeyEvent>(new QKeyEvent(*e)));
-
-    boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
-    sym->set(e);
-    view_.view()->workAreaKeyPress(sym, q_key_state(e->state()));
-
+       if (USE_KEY_BUFFERING) {
+               keyeventQueue_.push(boost::shared_ptr<QKeyEvent>(new 
QKeyEvent(*e)));
+       }
+       else {
+               boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
+               sym->set(e);
+               view_.view()->workAreaKeyPress(sym, q_key_state(e->state()));
+       }
 }
 
-// This is not used for now...
+// This is used only if USE_KEY_BUFFERING is defined...
 void WorkArea::keyeventTimeout()
 {
        bool handle_autos = true;

Reply via email to