Re: [pollen] Why is render-from-source-or-output-path function quicker than get-source and then render?

2018-02-10 Thread Matthew Butterick

> On Feb 9, 2018, at 10:18 PM, Junsong Li  wrote:
> 
> I think I might have hit a bug in racket serve/servlet. The actual blocking 
> point is the pollen get-source. It runs only half way through for certain js 
> files (it detects markup, markdown, and are blocked before 
> null-source/scribble-source/...), and running get-source alone never had the 
> issue.

You may be right that there is some issue in serve/servlet. I've also 
occasionally had problems with CSS renders stalling out, especially ones that 
produce big files. I never came up with a consistent test case that produced an 
error, however, so I was never able to trace the source of the problem.

-- 
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.


[pollen] Why is render-from-source-or-output-path function quicker than get-source and then render?

2018-02-09 Thread Junsong Li
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.