audk/ShellPkg/Library/UefiShellDebug1CommandsLib
Laszlo Ersek f72fd9616e ShellPkg/Comp: add file buffering
The COMP shell command compares two files byte for byte. In order to
retrieve the bytes to compare, it currently invokes
gEfiShellProtocol->ReadFile() on both files, using a single-byte buffer
every time. This is very inefficient; the underlying
EFI_FILE_PROTOCOL.Read() function may be costly.

Read both file operands in chunks of "PcdShellFileOperationSize" bytes.
Draw bytes for comparison from the internal read-ahead buffers.

Some ad-hoc measurements on my laptop, using OVMF, and the 4KB default of
"PcdShellFileOperationSize":

- When comparing two identical 1MB files that are served by EnhancedFatDxe
  on top of VirtioScsiDxe, this patch brings no noticeable improvement;
  the comparison completes in <1s both before and after.

- When comparing two identical 1MB files served by VirtioFsDxe, the
  comparison time improves from 2 minutes 25 seconds to <1s.

Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3123
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Message-Id: <20210113085453.10168-2-lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2021-01-19 18:23:28 +00:00
..
Edit ShellPkg:Fix bug in FileBuffer.c 2020-11-06 01:34:11 +00:00
HexEdit ShellPkg: Fix spelling mistake for occurred 2020-08-19 00:54:23 +00:00
SmbiosView ShellPkg: Remove bogus "Bits" text from some smbiosview strings. 2021-01-11 02:09:10 +00:00
Comp.c ShellPkg/Comp: add file buffering 2021-01-19 18:23:28 +00:00
Compress.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Compress.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Dblk.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Dmem.c ShellPkg/UefiShellDebug1CommandsLib 2019-04-28 09:50:14 +08:00
DmpStore.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
EditInputBar.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
EditInputBar.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
EditMenuBar.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
EditMenuBar.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
EditStatusBar.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
EditStatusBar.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
EditTitleBar.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
EditTitleBar.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
EfiCompress.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
EfiDecompress.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
LoadPciRom.c ShellPkg: Unload image on EFI_SECURITY_VIOLATION 2019-09-25 10:03:58 +08:00
MemMap.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Mm.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Mode.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Pci.c MdePkg: Define structures for Resizable BAR Capability 2021-01-04 08:25:28 +00:00
Pci.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
SerMode.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
SetSize.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
SetVar.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
UefiShellDebug1CommandsLib.c ShellPkg: stop using EFI_HANDLE in place of EFI_HII_HANDLE 2019-10-09 09:40:10 +02:00
UefiShellDebug1CommandsLib.h ShellPkg: stop using EFI_HANDLE in place of EFI_HII_HANDLE 2019-10-09 09:40:10 +02:00
UefiShellDebug1CommandsLib.inf ShellPkg/Comp: add file buffering 2021-01-19 18:23:28 +00:00
UefiShellDebug1CommandsLib.uni ShellPkg/UefiShellDebug1CommandsLib: Update to support SmBios 3.3.0 2019-10-17 11:43:47 +08:00