[Pkg-xfce-devel] Bug#360533: xfce4-terminal: scrollback on long
output without newlines is very slow
Michael Gilbert
michael.s.gilbert at gmail.com
Mon Apr 3 01:19:18 UTC 2006
Package: xfce4-terminal
Version: 0.2.4-7
Severity: normal
if the output of a program is a long list of data that does not consist
of newlines, xfce terminal will be very slow. gnome terminal gets
around this limitation by limiting the scrollback in terms of bytes,
rather than line numbers. for example, 1000 lines of scrollback would
be limited to something like 80*1000 = 80,000 bytes of scrollback
instead of 1000 newlines.
the following code (which computes the largest known prime and outputs
that number to stdout; http://fabrice.bellard.free.fr/mersenne.html)
is a demonstration of this bug. the output causes xfce terminal to
practically grind to a halt. the problem arises because the output
contains no newlines. the computation itself only takes about 3 minutes
on my 1.6 GHz processor:
#!/bin/bash
echo '''#include <stdio.h>
int
m=754974721,N,t[1<<24],a,*p,i,e=30611555,j,s,c,U;f(d){for(s=1<<24;s/=2;d=d*
1LL*d%m)if(s<N)for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=*p+p[s],p[s]=(m+*p-p[s])*1LL
*c%m,*p++=a%m,c=c*1LL*d%m;for(j=0;i<N-1;){for(s=N/2;!((j^=s)&s);s/=2);if(++i<j)
a=t[i],t[i]=t[j],t[j]=a;}}main(){*t=2;U=N=1;while(e/=2){N*=2;U=U*1LL*(m+1)/2%m;f
(362);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;f(415027540);for(a=0,p=t;p<t+N;)a+=*p
<<(e&1),*p++=a%10,a/=10;}while(!*--p);t[0]--;while(p>=t)printf("%d",*p--);}'''
> largest-known-prime.c
gcc -o largest-known-prime largest-known-prime.c
../largest-known-prime
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (600, 'testing'), (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Versions of packages xfce4-terminal depends on:
ii libatk1.0-0 1.10.3-1 The ATK accessibility toolkit
ii libc6 2.3.6-3 GNU C Library: Shared libraries an
ii libcairo2 1.0.2-3 The Cairo 2D vector graphics libra
ii libdbus-1-2 0.61-5 simple interprocess messaging syst
ii libdbus-glib-1-2 0.61-5 simple interprocess messaging syst
ii libexo-0.3-0 0.3.1.4alpha2-r20235-1 Library with extensions for Xfce
ii libfontconfig1 2.3.2-1.1 generic font configuration library
ii libfreetype6 2.1.10-1 FreeType 2 font engine, shared lib
ii libglib2.0-0 2.10.1-2 The GLib library of C routines
ii libgtk2.0-0 2.8.13-1 The GTK+ graphical user interface
ii libice6 6.9.0.dfsg.1-4 Inter-Client Exchange library
ii libncurses5 5.5-1 Shared libraries for terminal hand
ii libpango1.0-0 1.12.0-2 Layout and rendering of internatio
ii libpng12-0 1.2.8rel-5 PNG library - runtime
ii libsm6 6.9.0.dfsg.1-4 X Window System Session Management
ii libstartup-notifi 0.8-1 library for program launch feedbac
ii libvte4 1:0.11.20-3 Terminal emulator widget for GTK+
ii libx11-6 6.9.0.dfsg.1-4 X Window System protocol client li
ii libxcursor1 1.1.3-1 X cursor management library
ii libxext6 6.9.0.dfsg.1-4 X Window System miscellaneous exte
ii libxfce4util-1 4.2.3.2-1 Utility functions library for Xfce
ii libxfcegui4-3 4.2.3-1 Basic GUI C functions for Xfce4
ii libxft2 2.1.8.2-3 FreeType-based font drawing librar
ii libxi6 6.9.0.dfsg.1-4 X Window System Input extension li
ii libxinerama1 6.9.0.dfsg.1-4 X Window System multi-head display
ii libxrandr2 6.9.0.dfsg.1-4 X Window System Resize, Rotate and
ii libxrender1 1:0.9.0.2-1 X Rendering Extension client libra
ii zlib1g 1:1.2.3-11 compression library - runtime
Versions of packages xfce4-terminal recommends:
ii dbus-1-utils 0.23.4-8 simple interprocess messaging syst
-- no debconf information
More information about the Pkg-xfce-devel
mailing list