зеркало из https://github.com/wieslawsoltes/SVG.git
Decrease memory usage on opening SVG document (#911)
* Use Concat and Join with ToArray instead of string aggregation * Fixes #909 'Very high memory usage (and allocations)' issue
This commit is contained in:
Родитель
eb1a73545d
Коммит
e42d4ff0f0
|
@ -501,7 +501,7 @@ namespace Svg
|
|||
|
||||
if (element.Nodes.OfType<SvgContentNode>().Any())
|
||||
{
|
||||
element.Content = (from e in element.Nodes select e.Content).Aggregate((p, c) => p + c);
|
||||
element.Content = string.Concat((from n in element.Nodes select n.Content).ToArray());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -535,7 +535,7 @@ namespace Svg
|
|||
|
||||
if (styles.Any())
|
||||
{
|
||||
var cssTotal = styles.Select((s) => s.Content).Aggregate((p, c) => p + Environment.NewLine + c);
|
||||
var cssTotal = string.Join(Environment.NewLine, styles.Select(s => s.Content).ToArray());
|
||||
var cssParser = new Parser();
|
||||
var sheet = cssParser.Parse(cssTotal ?? string.Empty);
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace Svg.Transforms
|
|||
{
|
||||
if (Count < 1)
|
||||
return string.Empty;
|
||||
return (from t in this select t.ToString()).Aggregate((p, c) => p + " " + c);
|
||||
return string.Join(" ", (from t in this select t.ToString()).ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@ The release versions are NuGet releases.
|
|||
|
||||
## Unreleased (master)
|
||||
|
||||
### Performance
|
||||
* reduce very high memory usage (see [#909](https://github.com/svg-net/SVG/issues/909))
|
||||
|
||||
### Fixes
|
||||
* fixed color blend position (see [#902](https://github.com/svg-net/SVG/issues/902))
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче