darcs

Issue 2385 darcs log is too slow

Title darcs log is too slow
Priority Status resolved
Milestone 2.10.0 Resolved in 2.10.0
Superseder Nosy List darcs-devel, gh, kowey, owst
Assigned To
Topics

Created on 2014-05-04.20:12:54 by gh, last changed 2015-02-21.21:46:42 by noreply.

Files
File name Uploaded Type Edit Remove
wip-invoke-pager-without-temp-file.dpatch gh, 2015-01-30.20:22:06 application/x-darcs-patch
Messages
msg17423 (view) Author: gh Date: 2014-05-04.20:12:53
In current darcs HEAD (tag 2.9.9).

`darcs log` is noticeably slower than `darcs log | less`.

This is because `darcs log` first creates a temporary file with its
output, and then runs the pager on it. On bigger repositories this is
desastrous for performance. It can also make darcs download old patches
when `darcs log -v` is ran (reported by Owen).

Could we lazily feed the pager instead of creating an intermediate file?
msg17894 (view) Author: gh Date: 2014-12-11.20:41:51
I have a patch that enables it to feed the output of "darcs log"
directly a pager, but it is not perfect since

1. when the pager is CTRL-C'ed the whole thing (darcs+pager) get interrupted
2. color is not yet displayed in less

You can find it at <http://hub.darcs.net/gh/darcs-scre‚Äč
ened_1/patch/20141210002305-5ef8f>
msg17921 (view) Author: bf Date: 2014-12-30.13:25:46
The process package has a configuration option to delegate Ctrl-C
handling to the subprocess if desired, see
http://hackage.haskell.org/package/process-1.2.1.0/docs/System-Process.html#t:CreateProcess
.
msg17926 (view) Author: gh Date: 2015-01-01.15:55:51
Yes, I have a patch that uses it, it requires process >= 1.2:

http://irclog.perlgeek.de/darcs/2014-12-19#i_9830495

The problem is that is seems to change darcs' default behaviour wrt ctrl-c.
msg17961 (view) Author: bf Date: 2015-01-28.21:02:05
Can you attach the patch here? I would like to play with it and perhaps
find a way around the problem you described.
msg17966 (view) Author: gh Date: 2015-01-30.20:22:06
Here is an updated patch that applies cleanly on HEAD. The "ctrl-c"
problem I mentioned in fixed (by a change in the process library). There
are still issues.

It requires process-1.2.2.0 which should be soon on hackage.

patch 2ab8afb8a58faf819ced6688b5938b2e84a06429
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Fri Jan 30 17:18:34 ART 2015
  * WIP invoke pager without temp file
  problems:
  * depend on process 1.2.2.0. We want 1.2 at least for the
    delegate_ctlc feature, but 1.2.2 fixes the following 
    bug: https://github.com/haskell/process/issues/15
  * colour not yet supported in less
  * bugs with remote push (ssh) (error message does not make sense)
  * cloning from ssh shows noise
Attachments
msg17973 (view) Author: ganesh Date: 2015-02-02.08:25:38
Won't depending on a very new process be a problem for old 
GHC/platforms?
msg17975 (view) Author: gh Date: 2015-02-02.19:22:27
Indeed. If we want this fix, we have to include the code of process
(BSD licensed) inside of darcs (like we currently do with containers).

The problem would be that process 1.2.2 has some dependencies lower
bounds that are higher than darcs' ones:
https://raw.githubusercontent.com/haskell/process/master/process.cabal

They are the following, and they are all provided by HP since 2012 [1]

* directory >= 1.1
* filepath >= 1.2
* Win32 >= 2.2
* unix >= 2.5

[1] https://www.haskell.org/platform/changelog.html
msg17976 (view) Author: gh Date: 2015-02-02.19:27:12
Hmm it's probably be harder than that in fact. Compiling process
requires running automake.
msg18001 (view) Author: bf Date: 2015-02-04.22:51:54
I needs to run configure but it always did that. If you build from the
git repo, you need to call 'autoreconf -i' but the cabal package, once
it gets released on hackage, will certainly contain the configure script
as it always did. I tested that the HEAD of process compiles cleanly
with ghc-7.4.1 (the oldest ghc we support), that is what comes with
debian 7.8. We should not bundle process but rather wait with 2.10 until
process-1.2.2.0 is on hackage.
msg18205 (view) Author: noreply Date: 2015-02-21.21:46:40
The following patch sent by Guillaume Hoffmann <guillaumh@gmail.com> updated issue issue2385 with
status=resolved;resolvedin=2.10.0 HEAD

* resolve issue2385: invoke pager without temporary file 
Ignore-this: 9133d1e66592f863295b0f405c2f10e3
History
Date User Action Args
2014-05-04 20:12:54ghcreate
2014-12-11 20:41:52ghsetmessages: + msg17894
2014-12-30 13:25:47bfsetmessages: + msg17921
2015-01-01 15:55:53ghsetmessages: + msg17926
2015-01-28 21:02:08bfsetmessages: + msg17961
2015-01-30 20:22:08ghsetfiles: + wip-invoke-pager-without-temp-file.dpatch
messages: + msg17966
2015-02-02 08:25:39ganeshsetmessages: + msg17973
2015-02-02 19:22:29ghsetmessages: + msg17975
2015-02-02 19:27:13ghsetmessages: + msg17976
2015-02-04 22:51:55bfsetmessages: + msg18001
2015-02-21 21:46:42noreplysetstatus: unknown -> resolved
messages: + msg18205
resolvedin: 2.10.0