audk/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
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

133 lines
3.4 KiB
INI

## @file
# Provides shell Debug1 profile functions
#
# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#
##
[Defines]
INF_VERSION = 0x00010006
BASE_NAME = UefiShellDebug1CommandsLib
FILE_GUID = 90330D51-A99B-4cc8-A2EB-AE22542A3F45
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.2
LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
CONSTRUCTOR = UefiShellDebug1CommandsLibConstructor
DESTRUCTOR = UefiShellDebug1CommandsLibDestructor
[Sources]
SetSize.c
Comp.c
Mode.c
MemMap.c
Compress.h
Compress.c
EfiCompress.c
EfiDecompress.c
Dmem.c
LoadPciRom.c
Mm.c
SetVar.c
SerMode.c
Pci.c
Pci.h
DmpStore.c
Dblk.c
SmbiosView/EventLogInfo.c
SmbiosView/EventLogInfo.h
SmbiosView/PrintInfo.c
SmbiosView/QueryTable.c
SmbiosView/SmbiosView.c
SmbiosView/SmbiosViewStrings.uni
SmbiosView/LibSmbiosView.c
SmbiosView/PrintInfo.h
SmbiosView/LibSmbiosView.h
SmbiosView/QueryTable.h
SmbiosView/SmbiosView.h
UefiShellDebug1CommandsLib.c
UefiShellDebug1CommandsLib.h
UefiShellDebug1CommandsLib.uni
## Files shared by both editors
EditTitleBar.h
EditTitleBar.c
EditInputBar.h
EditInputBar.c
EditStatusBar.h
EditStatusBar.c
EditMenuBar.h
EditMenuBar.c
## Files specific to the text editor
Edit/Edit.c
Edit/TextEditor.h
Edit/TextEditorTypes.h
Edit/FileBuffer.h
Edit/FileBuffer.c
Edit/MainTextEditor.h
Edit/MainTextEditor.c
Edit/Misc.h
Edit/Misc.c
Edit/TextEditStrings.uni
## Files specific to the HEX editor
HexEdit/BufferImage.h
HexEdit/BufferImage.c
HexEdit/Clipboard.h
HexEdit/Clipboard.c
HexEdit/DiskImage.h
HexEdit/DiskImage.c
HexEdit/FileImage.h
HexEdit/FileImage.c
HexEdit/HexEdit.c
HexEdit/HexEditor.h
HexEdit/HexEditorTypes.h
HexEdit/HexeditStrings.uni
HexEdit/MainHexEditor.h
HexEdit/MainHexEditor.c
HexEdit/MemImage.h
HexEdit/MemImage.c
HexEdit/Misc.h
HexEdit/Misc.c
[Packages]
MdePkg/MdePkg.dec
ShellPkg/ShellPkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
MemoryAllocationLib
BaseLib
BaseMemoryLib
IoLib
DebugLib
ShellCommandLib
ShellLib
UefiLib
UefiRuntimeServicesTableLib
UefiBootServicesTableLib
SortLib
PrintLib
BcfgCommandLib
[Pcd]
gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask ## CONSUMES
[Protocols]
gEfiPciRootBridgeIoProtocolGuid ## SOMETIMES_CONSUMES
gEfiBlockIoProtocolGuid ## SOMETIMES_CONSUMES
gEfiSimplePointerProtocolGuid ## SOMETIMES_CONSUMES
gEfiCpuIo2ProtocolGuid ## SOMETIMES_CONSUMES
[Guids]
gEfiGlobalVariableGuid ## SOMETIMES_CONSUMES ## GUID
gEfiSmbiosTableGuid ## SOMETIMES_CONSUMES ## SystemTable
gEfiSmbios3TableGuid ## SOMETIMES_CONSUMES ## SystemTable
gEfiMpsTableGuid ## SOMETIMES_CONSUMES ## SystemTable
gEfiAcpi10TableGuid ## SOMETIMES_CONSUMES ## SystemTable
gEfiAcpi20TableGuid ## SOMETIMES_CONSUMES ## SystemTable
gShellDebug1HiiGuid ## SOMETIMES_CONSUMES ## HII