Hi Rory,

I’m reviving this thread because it discusses the forecast extension, which I maintain.
  
The report that the forecast skin took over 100 seconds caught my attention, since it renders in about 2 seconds on my hardware.  I was able to reproduce the slowdown, and I can now say where it comes from.
  
I rendered the stock forecast skin -- all 12 sample pages, live NWS forecast data -- on a Raspberry Pi 5 under three different almanacs.  Identical skin, identical data; times are from the cheetahgenerator log line:
      
    built-in PyEphem almanac:     3.6 seconds    
    weewx-skyfield:                       4.4 seconds  (2.4 s steady-state in weewxd)
    weewx-skyfield-almanac:      81 seconds
  
So the slowdown reported here is real, and weewx-GTS is not needed to explain it -- my test system has no GTS installed.  On a machine slower than a Pi 5, 81 seconds lands right in the range you reported.
  
The mechanism: the forecast skin builds a fresh $almanac for every forecast period and asks each one for sunrise, sunset, moonrise, and moonset.  The strip pages do this for up to 300 periods, on several pages, which adds up to a few thousand rise/set searches per report cycle.  A single Skyfield rise/set search costs roughly 15-20 ms on a Pi 5, so an almanac that runs every search on every tag access lands at 80+ seconds.  PyEphem's searches are simply much cheaper, which is why this access pattern was never a problem before.
  
Many tags asking the same few astronomical questions is normal for WeeWX skins, so my weewx-skyfield extension [1] caches event searches inside its engine.  Forecast period timestamps repeat within a page, across pages, and across report cycles, so nearly every search after the first is a cache hit.  That is the entire difference: 4.4 seconds versus 81 seconds for the same skin doing the same work, both with a JPL ephemeris and current Skyfield.
  
The practical takeaway: Skyfield accuracy does not have to cost you your report time, and no skin changes are needed -- the stock forecast skin is fine as written.
  
I did not test the modified NeoWX Material skin from the original post, but any skin that loops over almanac rise/set tags is subject to the same arithmetic.
  

Cheers,
John

On Jan 12, 2026, at 12:53 PM, Karen K <[email protected]> wrote:

I added some documentation. And I made it possible that almanac_time can take a list of timestamps to speed up things. #19

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/e961cc4a-bf9e-4a2b-8d68-ba35a9a4036en%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/E9A3EDBF-E4A6-4230-98A5-DBB8EFBFC1B9%40johnkline.com.

Reply via email to