GNU nano - Patches: patch #9641, use unlocked reading for faster...
You are not allowed to post comments on this tracker with your current authentication level.
patch #9641: use unlocked reading for faster reads
Submitter: | easyaspi314 <easyaspi314> | ||
Submitted: | Sat 26 May 2018 03:56:54 AM UTC | ||
Priority: | 5 - Normal | Status: | Done |
Privacy: | Public | Assigned to: | bens |
Open/Closed: | Closed | Release: | None |
Jump to the original submission
Sun 23 Sep 2018 06:34:01 AM UTC, comment #27: |
Benno Schulenberg <bens> |
Thu 12 Jul 2018 10:52:06 AM UTC, comment #26: Thanks for confirming. Pushed to master, commit b2ff5746. |
Benno Schulenberg <bens> |
Thu 12 Jul 2018 12:58:55 AM UTC, comment #25: Oh, sorry for the inactivity.
|
easyaspi314 <easyaspi314> |
Tue 10 Jul 2018 12:39:37 PM UTC, comment #24: Devin, I propose to apply the attached version of the patch. Okay with you? |
Benno Schulenberg <bens> |
Mon 09 Jul 2018 09:44:36 PM UTC, comment #23: file #44520 is about 2-3ms faster than file #44334. My patch (file #44288) was about 10ms slower than this patch (file #44334) but a kernel upgrade has made my patch 35ms slower on cached reads and 50ms slower on cold reads.
|
Brand Huntsman <brand> |
Sun 08 Jul 2018 08:17:14 AM UTC, comment #22: I have reduced your last patch to just the getc_unlocked() call and the separate locking and unlocking-- see attached. This by itself already brings the loading time down from 1.2 to .75 seconds on my system. How much reduction do you guys get?
|
Benno Schulenberg <bens> |
Sat 07 Jul 2018 08:21:11 PM UTC, comment #21: On my system, file #44288 is consistently .01 seconds faster than file #44334. But that seems to be because of the 8K buffer used in the latter. When I make that a 4K buffer, the fastest time of file #44334 equals that of file #44288, but the variation is much bigger -- on average file #44288 still is faster.
|
Benno Schulenberg <bens> |
Mon 11 Jun 2018 02:28:58 AM UTC, comment #20: Oops. I saw the charalloc in do_lockfile and missed the fact that it was modifying existing code, which does have a free, just not in the patch. |
Brand Huntsman <brand> |
Sun 10 Jun 2018 01:17:28 PM UTC, comment #19: You mean the one in setvbuf?
|
easyaspi314 <easyaspi314> |
Sun 10 Jun 2018 02:47:16 AM UTC, comment #18: The patch improved performance in all cases on my system, even if the cold read difference was insignificant. I'll probably never see the 100% improvement I saw loading the cached 29meg file, but I'd like to know it was there if I do need it, and I love all insignificant performance increases (they add up). If no one else sees a performance decrease then I say the patch should be added.
|
Brand Huntsman <brand> |
Sun 10 Jun 2018 01:25:05 AM UTC, comment #17: Oh. Apparently flockfile is nooped if you don't enable pthreads on glibc. You might see this effect if you use -pthread.
|
easyaspi314 <easyaspi314> |
Sun 10 Jun 2018 01:13:50 AM UTC, comment #16: 1.635s cold read w/ slow_getc
|
Brand Huntsman <brand> |
Sun 10 Jun 2018 12:51:31 AM UTC, comment #15: Well, since you have glibc, to see what the difference is in the call on BSD/Android, try replacing the original getc version to use this:
|
easyaspi314 <easyaspi314> |
Sat 09 Jun 2018 08:07:58 PM UTC, comment #14: This removes a single file (million) from the cache, if you don't want to empty your entire cache.
|
Brand Huntsman <brand> |
Sat 09 Jun 2018 05:29:22 PM UTC, comment #13: By the way, the approximate equivalent of sudo purge on Linux and Android is
|
easyaspi314 <easyaspi314> |
Sat 09 Jun 2018 06:20:46 AM UTC, comment #12: This patch is faster than my patch at https://savannah.gnu.org/bugs/?50406 (tested with glibc)
|
Brand Huntsman <brand> |
Fri 08 Jun 2018 04:51:24 PM UTC, comment #11: Oops, thought I uploaded this. Shows you how forgetful I am. :(
|
easyaspi314 <easyaspi314> |
Sun 03 Jun 2018 07:41:14 PM UTC, comment #10: Ugh. Just realized I lost my post.
|
easyaspi314 <easyaspi314> |
Sun 03 Jun 2018 06:30:51 PM UTC, comment #9: What does file locking mean? And is it the repetitious locking and unlocking that takes so much time on other things than glibc? Or is it the being "locked" itself that slows things down?
|
Benno Schulenberg <bens> |
Sun 03 Jun 2018 12:46:51 PM UTC, comment #8: Bionic libc:
|
easyaspi314 <easyaspi314> |
Sun 03 Jun 2018 12:30:19 PM UTC, comment #7: Nice find.
|
easyaspi314 <easyaspi314> |
Sun 03 Jun 2018 10:02:28 AM UTC, comment #6: A real speedup can be achieved by calling mblen() only for characters that consist of multiple bytes. See attached patch. Result (against master, so without other patches applied):
|
Benno Schulenberg <bens> |
Sun 03 Jun 2018 09:09:11 AM UTC, comment #5: Hmm... I don't get the amount of speedup that you get. But then I don't have a purge command so I have to run with a hot cache, and I don't have a hard disk but a flash drive (eMMC).
|
Benno Schulenberg <bens> |
Sat 26 May 2018 06:33:27 PM UTC, comment #4: Thanks for the patch. Will look at this later -- am concentrating on the justification stuff these days. |
Benno Schulenberg <bens> |
Sat 26 May 2018 04:05:08 PM UTC, comment #3: This is embarrassing. Please ignore that previous patch. That was for dash. Silly thing changed the directory on me.
|
easyaspi314 <easyaspi314> |
Sat 26 May 2018 04:02:48 PM UTC, comment #2: Oops, well, I thought I did. Stupid Android browser. :(
|
easyaspi314 <easyaspi314> |
Sat 26 May 2018 04:00:48 PM UTC, comment #1: I forced nano to use an int64_t for the file size so the math doesn't overflow on 32-bit. |
easyaspi314 <easyaspi314> |
Sat 26 May 2018 03:56:54 AM UTC, original submission:
Instead of repeatedly reading the file byte by byte, nano will now read in 8KiB
|
easyaspi314 <easyaspi314> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 16 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2018-09-23 | bens | Open/Closed | Open | Closed | |
2018-07-12 | bens | Status | In Progress | Done | |
2018-07-10 | bens | Attached File | - | Added 0001-files-speed-up-reading-by-using-getc_unlocked-instea.patch, #44534 | |
Status | None | In Progress | |||
Assigned to | None | bens | |||
2018-07-08 | bens | Attached File | - | Added 0001-files-use-getc_unlocked-instead-of-getc-to-speed-up-.patch, #44520 | |
Summary | use buffered reading for faster reads | use unlocked reading for faster reads | |||
2018-07-07 | bens | Summary | use buffered reading for faster reads, and add a progress meter | use buffered reading for faster reads | |
2018-06-08 | easyaspi314 | Attached File | - | Added 0001-Use-manual-lock-getc_unlocked-use-fixed-size-buffer-.patch, #44334 | |
2018-06-03 | bens | Attached File | - | Added cut-a-corner.patch, #44285 | |
Summary | Use buffered reading and a progress meter for faster reads | use buffered reading for faster reads, and add a progress meter | |||
2018-06-03 | bens | Attached File | - | Added streamline-character-counting.patch, #44281 | |
Attached File | - | Added streamline-it-further.patch, #44282 | |||
2018-05-26 | easyaspi314 | Attached File | - | Added 0001-Use-buffered-reading-and-a-progress-meter-for-faster2.patch, #44220 | |
2018-05-26 | easyaspi314 | Attached File | - | Added 0001-Fix-some-portability-issues.patch, #44219 | |
2018-05-26 | easyaspi314 | Attached File | - | Added 0001-Use-buffered-reading-and-a-progress-meter-for-faster.patch, #44217 |
Powered by Savane 3.13-02a9.
Corresponding source code
Was released in 3.0.