TextUndo in Tk800.015 is slow deleting blocks of text 
Author Message
 TextUndo in Tk800.015 is slow deleting blocks of text

I just recently updated my Tk to 800.015 have noticed that all my apps
that use Tk::TextUndo take much longer to delete blocks of text from a
TextUndo window. On my system (Sun Sparc-20), deleting a block a text
that is several hundred lines long now takes several seconds. The
previous Tk (800.014) did not have this delay.

Has anybody else seen this?

Example to try:
1) Run the adj_demo program in the main Tk build directory. Open a large
file (like tkGlue.c) by double-clicking the file in the left window.
2) Select a large portion of text in the text window, say the first 1/4
of the text in the file.
3) Press delete. On my system, the system freezes for several seconds,
and then the text is deleted.

Using the perl profiler (perl -d::DProf adj_demo), it appears that the
delay is occurring in Tk::TextUndo::tagSequential

My perl info:

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos nbdb1 5.5.1 generic_103640-22 sun4m sparc
sunw,sparcstation-10 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib'

Characteristics of this binary (from libperl):
  Built under solaris
  Compiled at Mar  2 1999 10:23:04
  %ENV:
    PERL5DB="BEGIN { require Tkperldb }"
    PERL5LIB="/home/cerney/perlsrc/myPerl5.005Libs"

    /home/cerney/perlsrc/myPerl5.005Libs/sun4-solaris
    /home/cerney/perlsrc/myPerl5.005Libs
    /home/cerney/perl5.005/lib/5.00502/sun4-solaris
    /home/cerney/perl5.005/lib/5.00502
    /home/cerney/perl5.005/lib/site_perl/5.005/sun4-solaris
    /home/cerney/perl5.005/lib/site_perl/5.005
    .



Mon, 11 Feb 2002 03:00:00 GMT  
 TextUndo in Tk800.015 is slow deleting blocks of text
[Cc'ed to the mailing list]

Quote:

> I just recently updated my Tk to 800.015 have noticed that all my apps
> that use Tk::TextUndo take much longer to delete blocks of text from a
> TextUndo window. On my system (Sun Sparc-20), deleting a block a text
> that is several hundred lines long now takes several seconds. The
> previous Tk (800.014) did not have this delay.

> Has anybody else seen this?

> Example to try:
> 1) Run the adj_demo program in the main Tk build directory. Open a large
> file (like tkGlue.c) by double-clicking the file in the left window.
> 2) Select a large portion of text in the text window, say the first 1/4
> of the text in the file.
> 3) Press delete. On my system, the system freezes for several seconds,
> and then the text is deleted.

> Using the perl profiler (perl -d::DProf adj_demo), it appears that the
> delay is occurring in Tk::TextUndo::tagSequential

The undo code is slower, because now also the tags are remembered. Try
the code below to override the delete_UNDO method.

To the mailing list: what about a configure option to suppress storing
the tag information? Or use smart code which determines if it should
use the current algorithm for smaller regions and another algorithm
using tagNames and tagRanges for bigger regions?

Regards,
        Slaven

package Tk::TextUndo;
use Tk::TextUndo;
sub delete_UNDO
{



- Show quoted text -

Quote:
}



Mon, 11 Feb 2002 03:00:00 GMT  
 TextUndo in Tk800.015 is slow deleting blocks of text
The following message is a courtesy copy of an article
that has been posted as well.

[Cc'ed to the mailing list]

Quote:

> I just recently updated my Tk to 800.015 have noticed that all my apps
> that use Tk::TextUndo take much longer to delete blocks of text from a
> TextUndo window. On my system (Sun Sparc-20), deleting a block a text
> that is several hundred lines long now takes several seconds. The
> previous Tk (800.014) did not have this delay.

> Has anybody else seen this?

> Example to try:
> 1) Run the adj_demo program in the main Tk build directory. Open a large
> file (like tkGlue.c) by double-clicking the file in the left window.
> 2) Select a large portion of text in the text window, say the first 1/4
> of the text in the file.
> 3) Press delete. On my system, the system freezes for several seconds,
> and then the text is deleted.

> Using the perl profiler (perl -d::DProf adj_demo), it appears that the
> delay is occurring in Tk::TextUndo::tagSequential

The undo code is slower, because now also the tags are remembered. Try
the code below to override the delete_UNDO method.

To the mailing list: what about a configure option to suppress storing
the tag information? Or use smart code which determines if it should
use the current algorithm for smaller regions and another algorithm
using tagNames and tagRanges for bigger regions?

Regards,
        Slaven

package Tk::TextUndo;
use Tk::TextUndo;
sub delete_UNDO
{



Quote:
}

==========================================================================
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Mon, 11 Feb 2002 03:00:00 GMT  
 TextUndo in Tk800.015 is slow deleting blocks of text

Quote:


> > I just recently updated my Tk to 800.015 have noticed that all my apps
> > that use Tk::TextUndo take much longer to delete blocks of text from a
> > TextUndo window. On my system (Sun Sparc-20), deleting a block a text
> > that is several hundred lines long now takes several seconds. The
> > previous Tk (800.014) did not have this delay.

> > Has anybody else seen this?
> The undo code is slower, because now also the tags are remembered. Try
> the code below to override the delete_UNDO method.

> To the mailing list: what about a configure option to suppress storing
> the tag information? Or use smart code which determines if it should
> use the current algorithm for smaller regions and another algorithm
> using tagNames and tagRanges for bigger regions?

yep, 800.015 is slower for TextUndo.
I wrote some rather complex code that goes through
the text in sequence extracts the tags which gets
executed everytime you do a delete.
its the method called tagSequential.

then Nick told me everything in tagSequential could be
replaced by the ->dump method, and that its a lot faster.
oh well, nothing like reinventing the wheel once in a
while to keep you humble.

I dont have the exact fix, so I cant include it here.
but it has been taken care of, and should be part of
800.016 or whatever is the next release of Tk.

Slaven's code speeds things up because it doesn't
call tagSequential, which is another way to patch
it until the next release comes out.

Greg
==========================================================================
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Tue, 12 Feb 2002 03:00:00 GMT  
 TextUndo in Tk800.015 is slow deleting blocks of text
Glad to hear this is being addressed. This was causing an annoyance with
the operation of some textUndo-based widgets I wrote.

BTW, the other new features of the TextUndo widget are really cool.

Thanks,

John

Quote:

> yep, 800.015 is slower for TextUndo.
> I wrote some rather complex code that goes through
> the text in sequence extracts the tags which gets
> executed everytime you do a delete.
> its the method called tagSequential.

> then Nick told me everything in tagSequential could be
> replaced by the ->dump method, and that its a lot faster.
> oh well, nothing like reinventing the wheel once in a
> while to keep you humble.

> I dont have the exact fix, so I cant include it here.
> but it has been taken care of, and should be part of
> 800.016 or whatever is the next release of Tk.

> Slaven's code speeds things up because it doesn't
> call tagSequential, which is another way to patch
> it until the next release comes out.

> Greg
> ==========================================================================
> This message was posted through the Stanford campus mailing list
> server.  If you wish to unsubscribe from this mailing list, send the




Fri, 15 Feb 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. TextUndo incorrect behavior perl/tk800.015 bug?

2. Problem with Tk800.015 and Text Widget

3. Tk800.022 BUG?: Slow Tk800.022 compared to Tk800.015 when passing array reference in canvas->bind

4. filevent bug in Tk800.015 ??

5. Install failed Tk800.015

6. Perl/Tk800.015 Installation problem

7. Tk800.015 RPM package for Linux?

8. Problems loading TK800.015 on OSF 4.0f

9. Problems building Tk800.015

10. Tk800.015 PATCH: t/browseentry.t

11. Tk800.015 incompatible changes?

12. error building Tk800.015 under thread enabled perl5

 

 
Powered by phpBB® Forum Software