|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using System; |
|
|
|
using System.Linq; |
|
|
|
using Avalonia.Media; |
|
|
|
using Avalonia.Media.TextFormatting; |
|
|
|
using Avalonia.UnitTests; |
|
|
|
@ -10,9 +11,18 @@ namespace Avalonia.Benchmarks.Text; |
|
|
|
public class HugeTextLayout : IDisposable |
|
|
|
{ |
|
|
|
private readonly IDisposable _app; |
|
|
|
private string[] _manySmallStrings; |
|
|
|
private static Random _rand = new Random(); |
|
|
|
|
|
|
|
private static string RandomString(int length) |
|
|
|
{ |
|
|
|
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&?%$@"; |
|
|
|
return new string(Enumerable.Repeat(chars, length).Select(s => s[_rand.Next(s.Length)]).ToArray()); |
|
|
|
} |
|
|
|
|
|
|
|
public HugeTextLayout() |
|
|
|
{ |
|
|
|
_manySmallStrings = Enumerable.Range(0, 1000).Select(x => RandomString(_rand.Next(2, 15))).ToArray(); |
|
|
|
_app = UnitTestApplication.Start( |
|
|
|
TestServices.StyledWindow.With( |
|
|
|
renderInterface: new NullRenderingPlatform(), |
|
|
|
@ -29,11 +39,13 @@ One should, however, not forget that concentration of violations of the strategi |
|
|
|
In a loose sense concentration of the center of the critical thinking provides a deep insight into the emergency planning. The comparison is quite a powerful matter. |
|
|
|
Resulting from review or analysis of threats and opportunities, we can presume that either significant improvement or basics of planning and scheduling reveals the patterns of the final draft. Therefore, the concept of the crucial component can be treated as the only solution. |
|
|
|
One should, nevertheless, consider that the exceptional results of the diverse sources of information gives an overview of the production cycle. It should rather be regarded as an integral part of the direct access to key resources. |
|
|
|
Admitting that the possibility of achieving the results of the constructive criticism, as far as the strategic management is questionable, cannot rely only on the critical thinking. It may reveal how the systems approach partially the comprehensive project management. We must be ready for outline design stage and network development investigation of every contradiction between the effective time management and the efficient decision the network development. Everyone understands what it takes to the draft analysis and prior decisions and early design solutions. In any case, we can systematically change the mechanism of the sources and influences of the continuing financing doctrine. This could exceedingly be a result of a task analysis the hardware maintenance. The real reason of the strategic planning seemingly the influence on eventual productivity. Everyone understands what it takes to the well-known practice. Therefore, the concept of the productivity boost can be treated as the only solution the driving factor. It may reveal how the matters of peculiar interest slowly the goals and objectives or the diverse sources of information the positive influence of any major outcomes complete failure of the supposed theory. |
|
|
|
Admitting that the possibility of achieving the results of the constructive criticism, as far as the strategic management is questionable, cannot rely only on the critical thinking. It may reveal how the systems approach partially the comprehensive project management. We must be ready for outline design stage and network development investigation of every contradiction between the effective time management and the efficient decision the network development. |
|
|
|
Everyone understands what it takes to the draft analysis and prior decisions and early design solutions. In any case, we can systematically change the mechanism of the sources and influences of the continuing financing doctrine. This could exceedingly be a result of a task analysis the hardware maintenance. The real reason of the strategic planning seemingly the influence on eventual productivity. Everyone understands what it takes to the well-known practice. Therefore, the concept of the productivity boost can be treated as the only solution the driving factor. |
|
|
|
It may reveal how the matters of peculiar interest slowly the goals and objectives or the diverse sources of information the positive influence of any major outcomes complete failure of the supposed theory. |
|
|
|
In respect that the structure of the sufficient amount poses problems and challenges for both the set of related commands and controls and the ability bias.";
|
|
|
|
|
|
|
|
[Benchmark] |
|
|
|
public TextLayout BuildTextLayout() => new TextLayout(Text, Typeface.Default, 12d, Brushes.Black); |
|
|
|
public TextLayout BuildTextLayout() => MakeLayout(Text); |
|
|
|
|
|
|
|
private const string Emojis = @"๐ ๐ ๐ ๐คฃ ๐ ๐ ๐
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ฅฐ ๐ ๐ ๐ โบ๏ธ ๐ ๐ค ๐คฉ ๐ค ๐คจ ๐ ๐ ๐ถ ๐ ๐ ๐ฃ ๐ฅ ๐ฎ ๐ค ๐ฏ ๐ช ๐ซ ๐ด ๐ ๐ ๐ ๐ ๐คค ๐ ๐ ๐ ๐ ๐ ๐ค ๐ฒ โน๏ธ ๐ ๐ ๐ ๐ ๐ค ๐ข ๐ญ ๐ฆ ๐ง ๐จ ๐ฉ ๐คฏ ๐ฌ ๐ฐ ๐ฑ ๐ฅต ๐ฅถ ๐ณ ๐คช ๐ต ๐ก ๐ ๐คฌ ๐ท ๐ค ๐ค ๐คข ๐คฎ ๐คง ๐ ๐ค ๐คก ๐ฅณ ๐ฅด ๐ฅบ ๐คฅ ๐คซ ๐คญ ๐ง ๐ค ๐ ๐ฟ ๐น ๐บ ๐ ๐ป ๐ฝ ๐ค ๐ฉ ๐บ ๐ธ ๐น ๐ป ๐ผ ๐ฝ ๐ ๐ฟ ๐พ
|
|
|
|
๐ถ ๐ง ๐ง ๐ฆ ๐ฉ ๐ง ๐จ ๐ต ๐ง ๐ด ๐ฒ ๐ณโโ๏ธ ๐ณโโ๏ธ ๐ง ๐ง ๐ฑโโ๏ธ ๐ฑโโ๏ธ ๐จโ๐ฆฐ ๐ฉโ๐ฆฐ ๐จโ๐ฆฑ ๐ฉโ๐ฆฑ ๐จโ๐ฆฒ ๐ฉโ๐ฆฒ ๐จโ๐ฆณ ๐ฉโ๐ฆณ ๐ฆธโโ๏ธ ๐ฆธโโ๏ธ ๐ฆนโโ๏ธ ๐ฆนโโ๏ธ ๐ฎโโ๏ธ ๐ฎโโ๏ธ ๐ทโโ๏ธ ๐ทโโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐ต๏ธโโ๏ธ ๐ต๏ธโโ๏ธ ๐ฉโโ๏ธ ๐จโโ๏ธ ๐ฉโ๐พ ๐จโ๐พ ๐ฉโ๐ณ ๐จโ๐ณ ๐ฉโ๐ ๐จโ๐ ๐ฉโ๐ค ๐จโ๐ค ๐ฉโ๐ซ ๐จโ๐ซ ๐ฉโ๐ญ ๐จโ๐ญ ๐ฉโ๐ป ๐จโ๐ป ๐ฉโ๐ผ ๐จโ๐ผ ๐ฉโ๐ง ๐จโ๐ง ๐ฉโ๐ฌ ๐จโ๐ฌ ๐ฉโ๐จ ๐จโ๐จ ๐ฉโ๐ ๐จโ๐ ๐ฉโโ๏ธ ๐จโโ๏ธ ๐ฉโ๐ ๐จโ๐ ๐ฉโโ๏ธ ๐จโโ๏ธ ๐ฐ ๐คต ๐ธ ๐คด ๐คถ ๐
๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐ผ ๐คฐ ๐คฑ ๐โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐
โโ๏ธ ๐
โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐คฆโโ๏ธ ๐คฆโโ๏ธ ๐คทโโ๏ธ ๐คทโโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐งโโ๏ธ ๐งโโ๏ธ ๐
๐คณ ๐ ๐บ ๐ฏโโ๏ธ ๐ฏโโ๏ธ ๐ด ๐ถโโ๏ธ ๐ถโโ๏ธ ๐โโ๏ธ ๐โโ๏ธ ๐ซ ๐ญ ๐ฌ ๐ ๐ฉโโค๏ธโ๐ฉ ๐จโโค๏ธโ๐จ ๐ ๐ฉโโค๏ธโ๐โ๐ฉ ๐จโโค๏ธโ๐โ๐จ ๐ช ๐จโ๐ฉโ๐ง ๐จโ๐ฉโ๐งโ๐ฆ ๐จโ๐ฉโ๐ฆโ๐ฆ ๐จโ๐ฉโ๐งโ๐ง ๐ฉโ๐ฉโ๐ฆ ๐ฉโ๐ฉโ๐ง ๐ฉโ๐ฉโ๐งโ๐ฆ ๐ฉโ๐ฉโ๐ฆโ๐ฆ ๐ฉโ๐ฉโ๐งโ๐ง ๐จโ๐จโ๐ฆ ๐จโ๐จโ๐ง ๐จโ๐จโ๐งโ๐ฆ ๐จโ๐จโ๐ฆโ๐ฆ ๐จโ๐จโ๐งโ๐ง ๐ฉโ๐ฆ ๐ฉโ๐ง ๐ฉโ๐งโ๐ฆ ๐ฉโ๐ฆโ๐ฆ ๐ฉโ๐งโ๐ง ๐จโ๐ฆ ๐จโ๐ง ๐จโ๐งโ๐ฆ ๐จโ๐ฆโ๐ฆ ๐จโ๐งโ๐ง ๐คฒ ๐ ๐ ๐ ๐ค ๐ ๐ ๐ โ ๐ค ๐ค ๐ค โ๏ธ ๐ค ๐ค ๐ ๐ ๐ ๐ ๐ โ๏ธ โ ๐ค ๐ ๐ ๐ ๐ค ๐ช ๐ฆต ๐ฆถ ๐ โ๏ธ ๐ ๐ ๐ ๐ ๐ ๐
๐ ๐ ๐ฃ ๐ ๐ ๐ง ๐ฆด ๐ฆท ๐ฃ ๐ค ๐ฅ |
|
|
|
@ -53,7 +65,13 @@ In respect that the structure of the sufficient amount poses problems and challe |
|
|
|
๐ฅฑ ๐ค ๐ฆพ ๐ฆฟ ๐ฆป ๐ง ๐งโโ๏ธ ๐งโโ๏ธ ๐ง ๐งโโ๏ธ ๐งโโ๏ธ ๐ง ๐งโโ๏ธ ๐งโโ๏ธ ๐จโ๐ฆฏ ๐ฉโ๐ฆฏ ๐จโ๐ฆผ ๐ฉโ๐ฆผ ๐จโ๐ฆฝ ๐ฉโ๐ฆฝ ๐ฆง ๐ฆฎ ๐โ๐ฆบ ๐ฆฅ ๐ฆฆ ๐ฆจ ๐ฆฉ ๐ง ๐ง
๐ง ๐ง ๐ง ๐ฆช ๐ง ๐ง ๐ง ๐ ๐ฆฝ ๐ฆผ ๐บ ๐ช ๐ช ๐คฟ ๐ช ๐ช ๐ฆบ ๐ฅป ๐ฉฑ ๐ฉฒ ๐ฉณ ๐ฉฐ ๐ช ๐ช ๐ช ๐ฆฏ ๐ฉธ ๐ฉน ๐ฉบ ๐ช ๐ช ๐ค ๐ค ๐ ๐ก ๐ข ๐ฃ ๐ค ๐ฅ ๐ง ๐จ ๐ฉ ๐ฆ ๐ช ๐ซ";
|
|
|
|
|
|
|
|
[Benchmark] |
|
|
|
public TextLayout BuildEmojisTextLayout() => new TextLayout(Emojis, Typeface.Default, 12d, Brushes.Black); |
|
|
|
public TextLayout BuildEmojisTextLayout() => MakeLayout(Emojis); |
|
|
|
|
|
|
|
[Benchmark] |
|
|
|
public TextLayout[] BuildManySmallTexts() => _manySmallStrings.Select(MakeLayout).ToArray(); |
|
|
|
|
|
|
|
private static TextLayout MakeLayout(string str) |
|
|
|
=> new TextLayout(str, Typeface.Default, 12d, Brushes.Black, maxWidth:120); |
|
|
|
|
|
|
|
public void Dispose() |
|
|
|
{ |
|
|
|
|