David Keller

Results 57 comments of David Keller

I think it may be useful to try the benchmark using musl libc. Maybe glibc is just slow here? As for other allocators, I have no idea how to try...

@asterite > I think Ruby uses xmalloc: > > https://github.com/ruby/ruby/blob/6a1365d725c72107dd45e1b06ce4acc5549ebaf5/ext/zlib/zlib.c#L632-L633 > > https://github.com/ruby/ruby/blob/6a1365d725c72107dd45e1b06ce4acc5549ebaf5/ext/zlib/zlib.c#L608-L610 I just looked at the code, it seems that's just LibC malloc. `xmalloc2` is defined as `ruby_xmalloc2`:...

> It seems odd that `GC.malloc_atomic` crashes here. Not really, the GC just frees objects only referenced from objects which itself were allocated using malloc_atomic.

@straight-shoota > I think `GC.malloc_atomic` would probably be better than `LibC.malloc` Those C libraries probably store pointers to allocated memory inside allocated memory (which happens very easily for example with...

Actually, the performance difference between crystal and ruby is not that big. Here's a benchmark using `Benchmark.ips` for both the given example string (43 bytes) and a more realistic size...

> But it would probably be helpful to replace `localhost` by the loopback address `"127.0.0.1"` directly, so the example should work regardless of hostname resolution. Alternatively, we could also use...

I think they could be useful for macros.

The same issue also applies to char literals. ```cr ' ' puts __LINE__ #=> 2 ``` LF should probably be forbidden inside char literals (it also doesn't compile with CRLF).

You can already do this using the BDWGC environment variable `GC_DONT_GC` Example: ```bash $ GC_DONT_GC=1 time crystal build src/app.cr 1.36user 0.95system 0:01.91elapsed 121%CPU (0avgtext+0avgdata 518428maxresident)k 0inputs+9384outputs (0major+170188minor)pagefaults 0swaps $ GC_DO_GC=1...

@MistressRemilia You're executing your whole rakefile without GC, which can decrease performance dramatically. It probably: - Executes the rake process - Executes crystal to compile the rakefile - Executes the...