Re: Efficiency of `map`

2017-06-10 Thread Mark H Weaver
Nala Ginrut writes: > Do you have any advice to optimize it without disable GC temperaly? Temporarily disabling the GC would merely postpone reclamation work that needs to be done eventually, and at the risk of allocating a potentially huge amount of garbage while the GC is

Re: Efficiency of `map`

2017-06-09 Thread Nala Ginrut
Hi Mark! Do you have any advice to optimize it without disable GC temperaly? Or the only way is to change a better GC? 2017年6月10日 12:28,"Mark H Weaver" 写道: > Stefan Monnier writes: > > >> (define (map f l) > >> (if (pair? l) > >> (cons (f

Re: Efficiency of `map`

2017-06-09 Thread Mark H Weaver
Stefan Monnier writes: >> (define (map f l) >> (if (pair? l) >> (cons (f (car l)) >> (map f (cdr l))) >> '())) >> >> whereas we used to have to write code like this in order to support long >> lists without overflowing the stack: >>

Efficiency of `map` (was: [PATCH] On Hurd, don't use not implemented madvise())

2017-06-08 Thread Stefan Monnier
> (define (map f l) > (if (pair? l) > (cons (f (car l)) > (map f (cdr l))) > '())) > > whereas we used to have to write code like this in order to support long > lists without overflowing the stack: > > (define (map f l) > (let loop ((l l) (out '())) >