terminal/src/server
Michael Niksa f087d03eb2
Reduce Transient Allocations during Bulk Text Output (#8617)
Make a few changes to memory usage throughout the application to reduce transient allocations from the `big.txt` test from ~213,000 to ~53,000.

## PR Checklist
* [x] Supports #3075
* [x] I work here.
* [x] Tested manually and WPR'd. Test suite should still pass.
* [x] Am core contributor

## Detailed Description of the Pull Request / Additional comments

Transient allocations are those that are new'd, used, then delete'd. Going back and forth to the system allocator for things we're just going to throw away or use rapidly again is a performance detriment. Not only is it a bunch of time to go ask the system with a syscall, it also hits a whole bunch of locks on the allocators. This PR identifies a few places where we were accidentally allocating and didn't mean to or were allocating and freeing just to turn around and allocate again. I chose other strategies to avoid this.

## Validation Steps Performed
- Ran `big.txt` sample (~6MB file) before and after. Observed heap allocations with WPR.
2021-01-05 18:06:06 +00:00
..
lib Convert DeviceComm into an interface and add handle exchange (#8367) 2020-12-15 23:07:43 +00:00
ApiDispatchers.cpp Reduce Transient Allocations during Bulk Text Output (#8617) 2021-01-05 18:06:06 +00:00
ApiDispatchers.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
ApiDispatchersInternal.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
ApiMessage.cpp Reduce Transient Allocations during Bulk Text Output (#8617) 2021-01-05 18:06:06 +00:00
ApiMessage.h Reduce Transient Allocations during Bulk Text Output (#8617) 2021-01-05 18:06:06 +00:00
ApiMessageState.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ApiMessageState.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ApiSorter.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ApiSorter.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ConDrvDeviceComm.cpp Convert DeviceComm into an interface and add handle exchange (#8367) 2020-12-15 23:07:43 +00:00
ConDrvDeviceComm.h Convert DeviceComm into an interface and add handle exchange (#8367) 2020-12-15 23:07:43 +00:00
ConsoleShimPolicy.cpp Reintroduce a color compatibility hack, but only for PowerShells (#6810) 2020-07-10 15:25:39 -07:00
ConsoleShimPolicy.h Reintroduce a color compatibility hack, but only for PowerShells (#6810) 2020-07-10 15:25:39 -07:00
DeviceComm.h Convert DeviceComm into an interface and add handle exchange (#8367) 2020-12-15 23:07:43 +00:00
DeviceHandle.cpp Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016) 2020-01-03 10:44:27 -08:00
DeviceHandle.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
dirs Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
Entrypoints.cpp Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
Entrypoints.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
IApiRoutines.h Replace basic_string_view<T> with span<const T> (#6921) 2020-07-15 16:40:42 +00:00
IoDispatchers.cpp Convert DeviceComm into an interface and add handle exchange (#8367) 2020-12-15 23:07:43 +00:00
IoDispatchers.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
IoSorter.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
IoSorter.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
IoThread.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
IWaitRoutine.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ObjectHandle.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
ObjectHandle.h Prevent cleanup of object given to handle that failed access check (#3414) 2019-11-05 14:22:55 -08:00
ObjectHeader.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
ObjectHeader.h Prevent cleanup of object given to handle that failed access check (#3414) 2019-11-05 14:22:55 -08:00
precomp.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
precomp.h Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
ProcessHandle.cpp Convert DeviceComm into an interface and add handle exchange (#8367) 2020-12-15 23:07:43 +00:00
ProcessHandle.h Convert DeviceComm into an interface and add handle exchange (#8367) 2020-12-15 23:07:43 +00:00
ProcessList.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
ProcessList.h Revert locking changes (#3488) 2019-11-08 13:44:52 -08:00
ProcessPolicy.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
ProcessPolicy.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
sources.inc Convert DeviceComm into an interface and add handle exchange (#8367) 2020-12-15 23:07:43 +00:00
WaitBlock.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
WaitBlock.h Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
WaitQueue.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
WaitQueue.h Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
WaitTerminationReason.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
winbasep.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
WinNTControl.cpp Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016) 2020-01-03 10:44:27 -08:00
WinNTControl.h Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016) 2020-01-03 10:44:27 -08:00