Re: templates and traits

2023-03-18 Thread Chris Katko via Digitalmars-d-learn
On Saturday, 18 March 2023 at 20:42:50 UTC, Nick Treleaven wrote: On Saturday, 18 March 2023 at 19:22:07 UTC, Chris Katko wrote: ... So there's multiple sub-problems to solve. I asked this years ago, and got 90% of the way done and then lost the code and cannot find the original forum post.

Re: What makes vibe.d Incredibly Slow on a VPS?

2023-03-18 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/18/23 9:36 AM, seany wrote: But on a VPS server, the program outputs the first writeln line (not even the consequent req.form printouts), then apparently stops for several seconds ( 10 to 16) , and then suddenly starts working again. I see this in the log outputs. Why does this happen?

What makes vibe.d Incredibly Slow on a VPS?

2023-03-18 Thread seany via Digitalmars-d-learn
Consider this fraction of code Please: void createNewOwner(HTTPServerRequest req, HTTPServerResponse res) { writeln("NEW OWNER requests are : -");

Re: const in functions

2023-03-18 Thread Salih Dincer via Digitalmars-d-learn
On Friday, 17 March 2023 at 22:41:18 UTC, Ali Çehreli wrote: My comment was purely technical. What I meant is, if the code is an island where there is no single 'const' in sight, then a D programmer can live by ignoring 'const'. At a technical level... This is different from C++ where you

templates and traits

2023-03-18 Thread Chris Katko via Digitalmars-d-learn
Given: ```D struct pos {float x, y;} draw(myBitmap, pos(320, 240), centered); draw(pos(320, 240), myBitmap); draw("text", myFont, pos(320, 240)); ``` I'm writing a general "draw" template function that through compile-time, calls an associated DAllegro/Allegro 5 function: ``` draw(myBitmap,

Re: Global thread-local free-list allocator

2023-03-18 Thread Witold via Digitalmars-d-learn
On Friday, 17 March 2023 at 07:56:28 UTC, Herbie Melbourne wrote: On Thursday, 16 March 2023 at 20:53:28 UTC, Witold wrote: I ported a classic DeltaBlue benchmark to D, and for allocations I use a mix of malloc/free (for structs with some trailing inline arrays), and new for some other structs

Re: templates and traits

2023-03-18 Thread Nick Treleaven via Digitalmars-d-learn
On Saturday, 18 March 2023 at 19:22:07 UTC, Chris Katko wrote: ... So there's multiple sub-problems to solve. I asked this years ago, and got 90% of the way done and then lost the code and cannot find the original forum post. Maybe it was this?: