diff --git a/FHEM/01_FHEMWEB.pm b/FHEM/01_FHEMWEB.pm index b477de3da..1660368b5 100644 --- a/FHEM/01_FHEMWEB.pm +++ b/FHEM/01_FHEMWEB.pm @@ -565,7 +565,8 @@ FW_Read($$) $arg = "" if(!defined($arg)); Log3 $FW_wname, 4, "$name $method $arg; BUFLEN:".length($hash->{BUF}); my $pf = AttrVal($FW_wname, "plotfork", undef); - $pf = 1 if(!defined($pf) && AttrVal($FW_wname, "plotEmbed", 0) == 2); + $pf = 1 if(!defined($pf) && + AttrVal($FW_wname, "plotEmbed", ($numCPUs>1 ? 2:0)) == 2); if($pf) { my $p = $data{FWEXT}; if(grep { $p->{$_}{FORKABLE} && $arg =~ m+^$FW_ME$_+ } keys %{$p}) { @@ -2028,7 +2029,7 @@ FW_showRoom() # Now the "atEnds" my $doBC = (AttrVal($FW_wname, "plotfork", 0) && - AttrVal($FW_wname, "plotEmbed", 0) == 0); + AttrVal($FW_wname, "plotEmbed", ($numCPUs>1 ? 2:0)) == 0); my %res; my ($idx,$svgIdx) = (1,1); @atEnds = sort { $sortIndex{$a} cmp $sortIndex{$b} } @atEnds; @@ -4040,10 +4041,11 @@ FW_log($$)
  • plotEmbed
    If set to 1, SVG plots will be rendered as part of <embed> - tags, as in the past this was the only way to display SVG. Setting - plotEmbed to 0 (the default) will render SVG in-place.
    + tags, as in the past this was the only way to display SVG. Setting + plotEmbed to 0 will render SVG in-place.
    Setting plotEmbed to 2 will load the SVG via JavaScript, in order to enable parallelization without the embed tag. + Default is 2 for multi-CPU hosts on Linux, and 0 everywhere else.

  • @@ -4798,10 +4800,11 @@ FW_log($$)
  • plotEmbed
    Falls 1, dann werden SVG Grafiken mit <embed> Tags gerendert, da auf älteren Browsern das die einzige - Möglichkeit war, SVG dastellen zu können. Falls 0 (die - Voreinstellung), dann werden die SVG Grafiken "in-place" gezeichnet. - Falls 2, dann werden die Grafiken per JavaScript nachgeladen, um eine - Parallelisierung auch ohne embed Tags zu ermöglichen. + Möglichkeit war, SVG dastellen zu können. Falls 0, dann + werden die SVG Grafiken "in-place" gezeichnet. Falls 2, dann werden + die Grafiken per JavaScript nachgeladen, um eine Parallelisierung auch + ohne embed Tags zu ermöglichen. + Die Voreinstellung ist 2 auf Mehrprozessor-Linux-Rechner und 0 sonst.

  • diff --git a/FHEM/98_SVG.pm b/FHEM/98_SVG.pm index 1618dfc2a..507bbced3 100644 --- a/FHEM/98_SVG.pm +++ b/FHEM/98_SVG.pm @@ -195,7 +195,7 @@ SVG_getplotsize($) sub SVG_embed() { - return AttrVal($FW_wname, "plotEmbed", 0); + return AttrVal($FW_wname, "plotEmbed", ($numCPUs>1 ? 2:0)); } sub diff --git a/fhem.pl b/fhem.pl index 661aba4d1..71631a94f 100755 --- a/fhem.pl +++ b/fhem.pl @@ -269,6 +269,7 @@ use vars qw(@authenticate); # List of authentication devices use vars qw(@authorize); # List of authorization devices use vars qw(@intAtA); # Internal timer array use vars qw(@structChangeHist); # Contains the last 10 structural changes +use vars qw($numCPUs); # Number of CPUs on Linux, else 1 use constant { DAYSECONDS => 86400, @@ -306,6 +307,8 @@ $init_done = 0; $lastDefChange = 0; $readytimeout = ($^O eq "MSWin32") ? 0.1 : 5.0; $featurelevel = 6.0; # see also GlobalAttr +$numCPUs = `grep -c ^processor /proc/cpuinfo 2>&1` if($^O eq "linux"); +$numCPUs = ($numCPUs && $numCPUs =~ m/(\d+)/ ? $1 : 1); $modules{Global}{ORDER} = -1;