So pollen-rock used to use the following code logic to decide whether to render 
a pollen source when a HTTP request coming in

  (let ((pollen-source (get-source filepath)))
    (when pollen-source
      (render-to-file-if-needed pollen-source))
    (next-dispatcher)))

For small projects, this works fine, but for a bigger project like pollen-tfl, 
the web server simply won’t return 2/5 of the css/js files, and eventually time 
out the request. I believe it’s the serv/servlet loops that’re choking (the 
some ormap in get-source didn’t finish). For curious mind, the source is 
https://github.com/lijunsong/pollen-rock/blob/2b2e5dd771f2671d3bc4cf6d19193c81bb8d2dc5/pollen-rock/main.rkt#L31

I noticed pollen server is using a function called 
render-from-source-or-output-path , which is defined here 
https://github.com/mbutterick/pollen/blob/5f338b5ecf9bbca7d7a44ca0e721b22a6cf8210a/pollen/render.rkt#L71

And once I switch to this function, pollen-rock dashboard can load normally. 
This function also loops over all source file types.

Has anyone noticed the performance difference of that two functions before?

-- 
You received this message because you are subscribed to the Google Groups 
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pollenpub+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to