Improvement: avoid building RotatedTextWithTerminator and have VirtuallyRotatedTextWithTerminator access directly to the underlying TextWithTerminator.
Currently the construction of a VirtuallyRotatedTextWithTerminator instance requires wrapping the underlying TextWithTerminator into a RotatedTextWithTerminator: c.p. the following excerpt from
|
new(new(text, text.Terminator, false), rotation); |
public static VirtuallyRotatedTextWithTerminator ToVirtuallyRotated(this TextWithTerminator text, int rotation) =>
new(new(text, text.Terminator, false), rotation);
Why: on large input (strings of hundreds of MB), a RotatedTextWithTerminator instance has to be built for each "virtual rotation" of the input, i.e. as many instances of this object are created as chars in the input. This leads to a high memory usage, and possibly to OutOfMemoryException.
Improvement: avoid building
RotatedTextWithTerminatorand haveVirtuallyRotatedTextWithTerminatoraccess directly to the underlyingTextWithTerminator.Currently the construction of a
VirtuallyRotatedTextWithTerminatorinstance requires wrapping the underlyingTextWithTerminatorinto aRotatedTextWithTerminator: c.p. the following excerpt fromMoreStructures/MoreStructures/TextWithTerminatorExtensions.cs
Line 40 in 0365e3b
Why: on large input (strings of hundreds of MB), a
RotatedTextWithTerminatorinstance has to be built for each "virtual rotation" of the input, i.e. as many instances of this object are created as chars in the input. This leads to a high memory usage, and possibly toOutOfMemoryException.