Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MC viewer is terribly slow in inefficient when jumping to the end of big files #1585

Closed
mc-butler opened this issue Sep 5, 2009 · 43 comments
Labels
area: mcview mcview, the built-in text editor prio: high Serious problem that could block progress
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/1585
Reporter birdie (aros@….com)
Mentions tux@….cz (@bilbo2), gotar (gotar@….pl), birdie (aros@….com)

Try to view a big enough (>10MB) file in Midnight Commander internal viewer and hit "End" button - the bigger is file, the longer it will take to scroll to the end of the file.

Jumping to the end of 50MB text file takes 5 (five!) seconds on my 2600MHz AMD 64 CPU. It is unacceptable.

It doesn't matter if you have "Wrap" or "UnWrap" setting.

An example file is attached.

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Sep 5, 2009 at 7:40 UTC

Sample file (use 7z to unpack it)

@mc-butler
Copy link
Author

Changed by ossi (@ossilator) on Sep 11, 2009 at 11:13 UTC (comment 1)

now try this with something *big* (say, /proc/kcore) and see your system choke.

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Sep 11, 2009 at 11:37 UTC (comment 2)

Are you scoffing at me or what?

MC 4.5.x and Far File Manager scroll to the end of any files instantly.

@mc-butler
Copy link
Author

Changed by mike.dld (mikedld@….com) on Sep 11, 2009 at 13:05 UTC (comment 3)

That's because MC scans all the file from top to bottom to display current line number in the status bar. The question is, do we really need this in viewer (FAR, for example, displays just a position percentage).

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Sep 11, 2009 at 16:13 UTC (comment 3.4)

Replying to mike.dld:

That's because MC scans all the file from top to bottom to display current line number in the status bar. The question is, do we really need this in viewer (FAR, for example, displays just a position percentage).

What really matters is an ability to view files of any size.

@mc-butler
Copy link
Author

Changed by bilbo (@bilbo2) on Sep 15, 2009 at 21:17 UTC (comment 5)

  • Cc set to tux@….cz

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on Nov 1, 2009 at 12:44 UTC (comment 6)

  • Cc changed from tux@….cz to tux@….cz, gotar@….pl

+1
Line number is irrevelant if I can't even view it.

@mc-butler
Copy link
Author

Changed by marrtins (marrtins@….net) on Nov 5, 2009 at 9:03 UTC (comment 7)

Hi to all mc developers! I work on quite large log-files on daily basis and this is getting *really* annoying. Pleasure to work on old servers with old mc. Please make this *feature* go away or at least configurable. Thank you very much!

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Nov 19, 2009 at 20:50 UTC (comment 7.8)

Replying to marrtins:

Hi to all mc developers! I work on quite large log-files on daily basis and this is getting *really* annoying. Pleasure to work on old servers with old mc. Please make this *feature* go away or at least configurable. Thank you very much!

Use older MC releases, until this bug is fixed.

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Nov 24, 2009 at 20:38 UTC (comment 9)

  • Type changed from defect to enhancement

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on Nov 24, 2009 at 21:53 UTC (comment 10)

  • Type changed from enhancement to defect

This is seriuos defect, please don't colorize stats by changing it to enhancement.

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Nov 24, 2009 at 22:08 UTC (comment 11)

please publish results testing 4.6.х VS 4.7.0 (current master)
test case:
view file ~3Gb (open in viewer and go to EOF)

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Nov 24, 2009 at 22:32 UTC (comment 12)

200MB text file:

MC 4.7.0-pre4: 40 seconds
MC 4.6.2-fc11: 11 seconds

However both results are unacceptable.

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Nov 24, 2009 at 22:35 UTC (comment 13)

3GB file is 15 times bigger than 200MB, so jumping to the end of file will take 10 (ten) minutes in MC 4.7.

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Nov 24, 2009 at 23:13 UTC (comment 14)

  • Status changed from new to accepted
  • Owner set to angel_il

ok, you right, i'm not... i try make viewer faster...

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Nov 25, 2009 at 0:22 UTC

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Nov 25, 2009 at 0:23 UTC (comment 15)

Out of curiosity I've just compiled MC 3.2.1 (the oldest version I could found on the net).

It jumps to the end of any file instantly. :)

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Nov 25, 2009 at 11:08 UTC (comment 15.16)

Replying to birdie:

Out of curiosity I've just compiled MC 3.2.1 (the oldest version I could found on the net).

It jumps to the end of any file instantly. :)

That's because MC scans all the file from top to bottom... (c)

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Nov 25, 2009 at 13:39 UTC

(In #1417) > I am searching for simple word in internal viewer in 24 Mb text file.

Internal mc viewer needs 22 seconds when positioned at start of the
file to reach end of the file and tell me the word is not found.

Well... as fact, this is trouble described in #1585. You may check it:

1) echo "FIND_ME" >>big_file.txt
2) open big_file.txt in viewer
3) press 'End' key. Viewer after some pause will positioning at end of file.
4) press 'Home' key. Viewer will return at start of file.
5) Press F7 and enter search string "FIND_ME"

Search will much faster in this test case. Slowdown in mcview_ccache_* functions... IMHO :)

Illiya: I reassign ticket to you. After fix #1585 need to recheck test cases again.

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Nov 26, 2009 at 8:47 UTC (comment 18)

OK... birdie, build [608e7b4] and try it...
before [608e7b4] mcview jumps to the EOF instantly.

git reset --hard 608e7b497032b4d0be155f56dcb19878872e3513
./autogen.sh
./configure
make

@mc-butler
Copy link
Author

Changed by ossi (@ossilator) on Nov 26, 2009 at 10:20 UTC (comment 19)

the correct command is

git checkout [608e7b4]

with reset --hard you will mess up the state of your local master branch. which is no biggie when you know how to recover ...

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 9, 2010 at 13:47 UTC (comment 20)

branch: 1585_slow_viewer

first step to make viewer faster

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 9, 2010 at 14:14 UTC (comment 21)

changeset: [e9a91a93e4e50aaa9d093da74e508421170896a1]

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 9, 2010 at 14:15 UTC (comment 22)

  • Severity changed from no branch to on review

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 12, 2010 at 18:54 UTC (comment 23)

  • Milestone changed from 4.7 to 4.7.1
  • Cc changed from tux@….cz, gotar@….pl to *tux@….cz, gotar, birdie, *
  • Version changed from 4.7.0-pre2 to master

initial: [f36016f253f9bd71b77e8498279ac84a32a2cb81]

@mc-butler
Copy link
Author

Changed by himikof (himikof@….com) on Jan 14, 2010 at 10:19 UTC

Strange behaviour testcase

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Jan 14, 2010 at 10:58 UTC (comment 24)

  • Severity changed from on review to on rework

@mc-butler
Copy link
Author

Changed by himikof (himikof@….com) on Jan 14, 2010 at 21:27 UTC (comment 25)

I have made a patch that fixes previously reported test case and removes unneeded eol_width parameter. Moving up-down seems to be working.

@mc-butler
Copy link
Author

Changed by himikof (himikof@….com) on Jan 14, 2010 at 21:28 UTC

Patch for mcview_bol/mcview_eol

@mc-butler
Copy link
Author

Changed by himikof (himikof@….com) on Jan 17, 2010 at 4:11 UTC

Fixes a few issues in left/right movement in hex viewer

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 18, 2010 at 8:38 UTC (comment 26)

inital commit: [dff373afb554e7087fe8bb3b751241f51681b80f]

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 18, 2010 at 14:55 UTC (comment 27)

  • Severity changed from on rework to on review

changeset: [d2668b1]

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Jan 19, 2010 at 10:28 UTC (comment 28)

  • Votes set to slavazanko

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 20, 2010 at 7:04 UTC (comment 29)

  • Severity changed from on review to approved
  • Votes changed from slavazanko to slavazanko andrew_b

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 20, 2010 at 7:34 UTC (comment 30)

  • Severity changed from approved to merged
  • Votes changed from slavazanko andrew_b to committed-master

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 20, 2010 at 7:45 UTC (comment 31)

Merged to master: [4c6b5fc].

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Jan 20, 2010 at 7:55 UTC (comment 32)

I haven't tested the patch yet, but I still say thank you very much!

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 20, 2010 at 8:50 UTC (comment 33)

  • Status changed from accepted to testing
  • Resolution set to fixed

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Jan 20, 2010 at 10:07 UTC (comment 34)

  • Keywords set to stable-candidate

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Jan 29, 2010 at 9:48 UTC

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Feb 24, 2010 at 12:44 UTC (comment 36)

  • Status changed from testing to closed

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 8, 2010 at 13:52 UTC (comment 37)

  • Keywords stable-candidate deleted

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Dec 23, 2020 at 12:57 UTC (comment 38)

  • Branch state set to merged
  • Cc changed from *tux@….cz, gotar, birdie, * to tux@….cz, gotar, birdie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mcview mcview, the built-in text editor prio: high Serious problem that could block progress
Development

No branches or pull requests

1 participant