From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: redisplay - very long lines Date: Mon, 16 Feb 2009 08:44:23 -0500 Message-ID: <3FEE1ADD-7471-4EA4-AE55-9175C9218B6E@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1234791919 4907 80.91.229.12 (16 Feb 2009 13:45:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Feb 2009 13:45:19 +0000 (UTC) To: Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 16 14:46:34 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LZ3nL-0007Z3-RK for ged-emacs-devel@m.gmane.org; Mon, 16 Feb 2009 14:46:00 +0100 Original-Received: from localhost ([127.0.0.1]:37909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZ3m1-0005RL-F1 for ged-emacs-devel@m.gmane.org; Mon, 16 Feb 2009 08:44:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LZ3lv-0005RG-Nf for emacs-devel@gnu.org; Mon, 16 Feb 2009 08:44:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LZ3lu-0005R4-PS for emacs-devel@gnu.org; Mon, 16 Feb 2009 08:44:30 -0500 Original-Received: from [199.232.76.173] (port=37727 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZ3lu-0005Qx-JW for emacs-devel@gnu.org; Mon, 16 Feb 2009 08:44:30 -0500 Original-Received: from qw-out-1920.google.com ([74.125.92.144]:47367) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LZ3lu-0003Ld-5Q for emacs-devel@gnu.org; Mon, 16 Feb 2009 08:44:30 -0500 Original-Received: by qw-out-1920.google.com with SMTP id 4so538298qwk.24 for ; Mon, 16 Feb 2009 05:44:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=AjIIv9IBU0CqXcocIUka8HpCjgwOuYw2VImAT1dqiU8=; b=Oh5d0zSgd7rezsVeV7kP3bLIhrAGhC4retZx/nlrAfyM1Saf61IqEuQSjm41J18mTe hDu6j5mqHD1FOui+1d759Wd1Hf8dbbUqUhOtXtNf55qzwJyz+l1zcNYvrGYHUNITF8br sH27U4zMtP6usQDtRmuo7B67LxE7vi+1jzDyU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=qYz4Jb/pyiJ4yqDZgfM7yv+NyE1WlXI+/QuHrCqbQNZHpcC8e/9w/NutFoaMMQllZs u4ISUv+urR+uZu575tD4ut/Zuik/tFnmgAtxOzQTYzc1WWBi+If/+oNbm3yObDohToB9 VOELJf9Nf82VAwwwDDZsWCFUXSfIouJ0CsbK8= Original-Received: by 10.224.2.74 with SMTP id 10mr2444655qai.255.1234791868151; Mon, 16 Feb 2009 05:44:28 -0800 (PST) Original-Received: from scarlett.local (pool-71-162-28-49.pitbpa.east.verizon.net [71.162.28.49]) by mx.google.com with ESMTPS id 2sm645356qwi.28.2009.02.16.05.44.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 16 Feb 2009 05:44:25 -0800 (PST) X-Mailer: Apple Mail (2.930.3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109104 Archived-At: The redisplay code seems to be unable to deal efficiently with very long lines, that is, lines that go beyond the currently displayed window. This was pointed out by a blogger who wanted to abuse Emacs to make a quick change to a binary file. I could reproduce the problem using a 17MB binary file, which loaded and displayed fine initially. I then removed all newlines from the file, upon which redisplay gets unbearably slow (minutes to redisplay once). Setting truncate-lines makes things faster, but not to the point where one could work. This is in version 22 and 23. The profiler output (Shark) is below. Would it be possible to add a termination condition in move_it_to to stop after leaving the window vertically or horizontally (with truncate-lines)? Or simply use a large enough threshold? 0.0% 99.8% Emacs start 0.0% 99.8% Emacs main 0.0% 99.8% Emacs Frecursive_edit 0.0% 99.8% Emacs recursive_edit_1 0.0% 99.8% Emacs command_loop 0.0% 99.8% Emacs internal_catch 0.0% 99.8% Emacs command_loop_2 0.0% 99.8% Emacs internal_condition_case 0.0% 99.8% Emacs command_loop_1 0.0% 99.8% Emacs call3 0.0% 99.8% Emacs Ffuncall 0.0% 99.8% Emacs Fcall_interactively 0.0% 99.8% Emacs apply1 0.0% 99.8% Emacs Fapply 0.0% 99.8% Emacs Ffuncall 0.0% 99.8% Emacs funcall_lambda 0.0% 99.8% Emacs Fbyte_code 0.0% 99.8% Emacs Ffuncall 0.0% 99.8% Emacs funcall_lambda 0.0% 99.8% Emacs Fbyte_code 0.0% 99.8% Emacs Ffuncall 0.0% 99.8% Emacs funcall_lambda 0.0% 99.8% Emacs Fbyte_code 0.0% 99.8% Emacs Ffuncall 0.0% 99.8% Emacs Freplace_match 0.0% 99.8% Emacs replace_range 0.0% 99.8% Emacs signal_after_change 0.0% 99.8% Emacs run_hook_with_args 0.0% 99.8% Emacs Ffuncall 0.0% 99.8% Emacs Fgarbage_collect 0.0% 99.8% Emacs truncate_undo_list 0.0% 99.8% Emacs call1 0.0% 99.8% Emacs Ffuncall 0.0% 99.8% Emacs funcall_lambda 0.0% 99.8% Emacs Fbyte_code 0.0% 99.8% Emacs Ffuncall 0.0% 99.8% Emacs funcall_lambda 0.0% 99.8% Emacs Fbyte_code 0.0% 99.8% Emacs Ffuncall 0.0% 99.8% Emacs funcall_lambda 0.0% 99.8% Emacs Fbyte_code 0.0% 99.8% Emacs Ffuncall 0.0% 99.8% Emacs Fredisplay 0.0% 99.8% Emacs redisplay_preserve_echo_area 0.0% 99.8% Emacs redisplay_internal 0.0% 99.8% Emacs redisplay_windows 0.0% 99.8% Emacs redisplay_windows 0.0% 99.8% Emacs internal_condition_case_1 0.0% 99.8% Emacs redisplay_window_0 0.0% 99.8% Emacs redisplay_window 0.0% 99.8% Emacs move_it_vertically_backward 0.0% 62.3% Emacs move_it_to 8.9% 62.0% Emacs move_it_in_display_line_to 14.2% 30.5% Emacs x_produce_glyphs 2.1% 9.3% Emacs get_per_char_metric 7.1% 7.1% Emacs nsfont_text_extents 3.3% 6.5% Emacs get_char_face_and_encoding 0.5% 0.5% Emacs take_vertical_position_into_account 0.1% 0.1% Emacs nsfont_text_extents 8.3% 17.5% Emacs get_next_display_element 3.5% 4.4% Emacs set_iterator_to_next 0.4% 0.4% Emacs next_element_from_display_vector 0.1% 0.1% Emacs next_element_from_buffer 0.1% 0.1% Emacs get_char_face_and_encoding 0.0% 0.0% Emacs char_table_ref 0.1% 0.1% Emacs set_iterator_to_next 0.1% 0.1% Emacs x_produce_glyphs 0.1% 0.1% Emacs get_next_display_element 0.0% 0.0% Emacs recenter_overlay_lists 0.0% 37.3% Emacs move_it_by_lines 0.0% 0.1% Emacs back_to_previous_visible_line_start 0.0% 0.0% Emacs line_bottom_y 0.0% 0.0% Emacs try_window 0.0% 0.0% Emacs move_it_by_lines 0.0% 0.0% Emacs prepare_menu_bars 0.1% 0.1% mach_kernel lo_alltraps 0.0% 0.0% mach_kernel i386_astintr 0.0% 0.0% mach_kernel lo_unix_scall 0.0% 0.0% mach_kernel IOWorkLoop::threadMain() 0.0% 0.0% mach_kernel thread_continue 0.0% 0.0% mach_kernel ml_set_interrupts_enabled 0.0% 0.0% mach_kernel lo_mach_scall