0

When using Microsoft WebView2 API which is still in beta at the time of writing this question we are experiencing a significant difference in performance between a Windows VCL version of the application and Windows Service.

In the desktop application response, times for checking values of a web page are approx 250ms In the service application response, times for the same checks are approx 8000ms

All interfaces are identical and we have tried different user permissions on the service to ascertain if the problem related to user permissions, however with the system functioning just being significantly delayed this can be discounted.

Previously we used Internet Explorer (COM Object) to achieve the outcomes but this has now been deprecated. The language we are using at present is Delphi (Object Pascal) though the usage is due to the API and can be agnostic and has been tested with C# to the same result.

Does anyone have experience of issues with windows services running slowly compared to the same code in a VCL application?

Reallyethical
  • 1,825
  • 2
  • 16
  • 26
  • Why do you need WebView in a service? That sounds strange. – Olivier Apr 01 '20 at 11:00
  • 2
    `WebView2` is designed to run in an interactive user session, not under a service context. Whatever the problem you are trying to solve, this is probably not a solution. – IInspectable Apr 01 '20 at 11:05
  • @IInspectable That was also what I thought, but I wasn't able to find any supporting quotes or references. Do you have any? – Peter Wolf Apr 01 '20 at 11:31
  • I agree with the comments above IE: your probably looking for a better solution, however ONE thought that does spring to mind is when/how are you initializing your webview control? If your initializing a new copy every time a specific request comes into your service, then that really is going to cause a massive slow down. Instead you should create a webview2 in your service start handler, then destroy it in the stop handler, then use the existing instance each time you need it. – shawty Jun 10 '20 at 11:39

0 Answers0