Dear GroupDocs Support Team,
I hope this message finds you well. I am writing to share feedback regarding the performance of GroupDocs.Watermark for .NET (v24.7.0) when processing large TIFF image files and to kindly request your guidance on potential optimizations.
In our use case, we applied a simple text watermark to a 220 MB TIFF image using the library. The process consistently took ~33 seconds to complete and consumed approximately 6.33 GB of RAM. While the watermarking functionality itself works correctly, the resource utilization and processing time seem disproportionately high for a single image operation.
Key Observations:
- Library Version: v24.7.0
- File Format: TIFF (220 MB)
- Avg. Processing Time: 33 seconds
- Avg. Memory Usage: 6.33 GB
internal class Program
{
static void Main(string[] args)
{
BenchmarkRunner.Run<GroupDocsWatermarkBenchmark>();
}
}
[HtmlExporter]
[MemoryDiagnoser]
public class GroupDocsWatermarkBenchmark
{
public GroupDocsWatermarkBenchmark()
{
ParamList = new List<Input>();
string resourcesDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources");
string outputDir = "output";
EnsureDirectoryExist(outputDir);
DirectoryInfo diResources = new DirectoryInfo(resourcesDir);
foreach (var file in diResources.GetFiles().OrderBy(t => t.Extension))
{
ParamList.Add(new Input
{
FileName = file.FullName,
OutputFileName = Path.Combine(outputDir, file.Name)
});
}
}
public List<Input> ParamList { get; }
[ParamsSource(nameof(ParamList))]
public Input CurrentParam { get; set; }
[Benchmark(Description = "GroupDocsTextWatermark")]
public void AddTextWatermarkByGroupDocs()
{
License license = new License();
license.SetLicense("GroupDocs.Watermark.NET.lic");
using (Watermarker watermarker = new Watermarker(CurrentParam.FileName))
{
TextWatermark watermark = new TextWatermark("绝密文件,禁止外发", new Font("simsun", 16));
watermark.RotateAngle = -45;
watermarker.Add(watermark);
watermarker.Save(CurrentParam.OutputFileName);
}
}
[Benchmark(Description = "GroupDocsImageWatermark")]
public void AddImageWatermarkByGroupDocs()
{
License license = new License();
license.SetLicense("GroupDocs.Watermark.NET.lic");
using (Watermarker watermarker = new Watermarker(CurrentParam.FileName))
{
ImageWatermark watermark = new ImageWatermark("watermark.png");
watermark.RotateAngle = -45;
watermarker.Add(watermark);
watermarker.Save(CurrentParam.OutputFileName);
}
}
private void EnsureDirectoryExist(string path)
{
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
}
}
public class Input
{
public string FileName { get; set; }
public string OutputFileName { get; set; }
public override string ToString()
{
return Path.GetFileName(FileName);
}
}
The benchmark summary is:
1.PNG (6.1 KB)
Questions:
- Are there recommended configuration settings or best practices to reduce memory footprint and improve processing speed for large TIFF files?
- Are there known limitations with TIFF processing (e.g., handling multi-page or high-resolution images) that could explain this behavior?
- Would upgrading to a newer version of GroupDocs.Watermark address these performance concerns?
- We value GroupDocs.Watermark’s reliability and features but hope to optimize its efficiency for large-scale operations. Any insights, workarounds, or roadmap details would be greatly appreciated.
Thank you for your time and assistance. I look forward to your suggestions.