Re: How to pass noncopyable variadic arguments with ref?

2022-11-03 Thread tchaloupka via Digitalmars-d-learn
On Friday, 21 October 2022 at 12:05:28 UTC, ryuukk_ wrote: On Thursday, 20 October 2022 at 14:03:10 UTC, tchaloupka wrote: void test(Foo..)(Foo foos) I don't know if that's the 1:1 alternative, but that doesn't compile onlineapp.d(23): Error: struct `onlineapp.Foo` is not copyable

How to pass noncopyable variadic arguments with ref?

2022-10-20 Thread tchaloupka via Digitalmars-d-learn
Hi, I've found strange behavior where: ```D import std.stdio; struct Foo { @disable this(this); int x; } void test(Foo[] foos...) { foreach (ref f; foos) { writeln(, ": ", f.x); f.x = 0; } } void main() { Foo f1 = Foo(1); Foo f2 = Foo(2);

Re: HTTP frameworks benchmark focused on D libraries

2022-05-30 Thread tchaloupka via Digitalmars-d-announce
On Sunday, 29 May 2022 at 06:22:43 UTC, Andrea Fontana wrote: On Thursday, 26 May 2022 at 07:49:23 UTC, tchaloupka wrote: I see there is a test where numbers are identical to arsd ones, is it a typo or a coincidence? Andrea Hi Andrea, it was just a coincidence, straight out copy of the tool

Re: Httparsed - fast native dlang HTTP 1.x message header parser

2022-05-28 Thread tchaloupka via Digitalmars-d-announce
On Saturday, 28 May 2022 at 05:37:06 UTC, test123 wrote: Maybe we can add the picohttpparser test case into httparsed. Hi, it is actually [there](https://github.com/tchaloupka/httparsed/blob/e07906e61b7c0b5123ecec4ea6a578b1768c47da/source/httparsed.d#L669), probably not exactly everything,

Re: HTTP frameworks benchmark focused on D libraries

2022-05-27 Thread tchaloupka via Digitalmars-d-announce
On Friday, 27 May 2022 at 20:51:14 UTC, zoujiaqing wrote: On Thursday, 26 May 2022 at 07:49:23 UTC, tchaloupka wrote: I fixed the performance bug the first time. (The default HTTP 1.1 connection is keep-alive) Archttp version 1.0.2 has been released, and retesting has yielded significant

Re: HTTP frameworks benchmark focused on D libraries

2022-05-26 Thread tchaloupka via Digitalmars-d-announce
Hi, as there are two more HTTP server implementations: * [Serverino](https://forum.dlang.org/thread/bqsatbwjtoobpbzxd...@forum.dlang.org) * [Archttp](https://forum.dlang.org/thread/jckjrgnmgsulewnre...@forum.dlang.org) It was time to update some numbers! Last results can be seen

Re: auto ref function parameter causes that non copyable struct is copied?

2021-11-09 Thread tchaloupka via Digitalmars-d-learn
On Monday, 8 November 2021 at 23:26:39 UTC, tchaloupka wrote: Bug or feature? :) I've reported it in https://issues.dlang.org/show_bug.cgi?id=22498.

Re: auto ref function parameter causes that non copyable struct is copied?

2021-11-08 Thread tchaloupka via Digitalmars-d-learn
On Tuesday, 9 November 2021 at 02:43:55 UTC, jfondren wrote: On Tuesday, 9 November 2021 at 02:41:18 UTC, jfondren wrote: The expectation is probably that `f.move` set `f` to `Foo.init`, but the docs say: Posted too fast. Foo qualifies with its @disable: ```d struct A { int x; } struct B {

auto ref function parameter causes that non copyable struct is copied?

2021-11-08 Thread tchaloupka via Digitalmars-d-learn
Lets have this code: ```D import core.lifetime : forward; import core.stdc.stdio; import std.algorithm : move; struct Value(T) { private T storage; this()(auto ref T val) { storage = forward!val; } ref inout(T) get() inout { return storage; } } Value!T

Problem using struct with copy constructor with betterC

2021-11-06 Thread tchaloupka via Digitalmars-d-learn
After a long fiddling with a code that won't compile I've got this test case: ```D struct Foo { this(ref return scope Foo rhs) {} ~this() {} } struct Bar { @disable this(this); Foo[2] foos; } extern (C) void main() {} ``` When built with `-betterC` switch (dmd as ldc2 works

Re: GC memory fragmentation

2021-04-14 Thread tchaloupka via Digitalmars-d-learn
On Tuesday, 13 April 2021 at 12:30:13 UTC, tchaloupka wrote: I'm not so sure if pages of small objects (or large) that are not completely empty can be reused as a new bucket or only free pages can be reused. Does anyone has some insight of this? Some kind of GC memory dump and analyzer tool

Re: GC memory fragmentation

2021-04-13 Thread tchaloupka via Digitalmars-d-learn
On Monday, 12 April 2021 at 07:03:02 UTC, Sebastiaan Koppe wrote: We have similar problems, we see memory usage alternate between plateauing and then slowly growing. Until it hits the configured maximum memory for that job and the orchestrator kills it (we run multiple instances and have

Re: GC memory fragmentation

2021-04-11 Thread tchaloupka via Digitalmars-d-learn
On Sunday, 11 April 2021 at 12:20:39 UTC, Nathan S. wrote: One thing that comes to mind: is your application compiled as 32-bit? The garbage collector is much more likely to leak memory with a 32-bit address space since it much more likely for a random int to appear to be a pointer to the

GC memory fragmentation

2021-04-11 Thread tchaloupka via Digitalmars-d-learn
Hi, we're using vibe-d (on Linux) for a long running REST API server and have problem with constantly growing memory until system kills it with OOM killer. First guess was some memory leak so we've added periodic call to: ```D GC.collect(); GC.minimize(); malloc_trim(0); ``` And when called

Re: Windows Bindings v1.0

2021-02-17 Thread tchaloupka via Digitalmars-d-announce
On Tuesday, 16 February 2021 at 08:45:19 UTC, Rumbu wrote: The D Windows SDK projection reached first version. Generated bindings were compiled succesfully. https://github.com/rumbu13/windows-d Destroy! Thanks for this, looks great. Could the generated code be annotated with nothrow @nogc

Re: Httparsed - fast native dlang HTTP 1.x message header parser

2020-12-15 Thread tchaloupka via Digitalmars-d-announce
On Tuesday, 15 December 2020 at 00:32:42 UTC, H. S. Teoh wrote: For that alone, I think Adam deserves a salute. (But of course, if Adam improves cgi.d to be competitive with vibe.d, then it could totally rock the D world! ;-)) T Yes absolutely, arsd has a bit different usecase and target

Httparsed - fast native dlang HTTP 1.x message header parser

2020-12-14 Thread tchaloupka via Digitalmars-d-announce
Hi, I was missing some commonly usable HTTP parser on code.dlang.org and after some research and work I've published httparsed[1]. It's inspired by picohttpparser[2] which is great, but instead of a binding, I wanted something native to D. Go has it's own parsers, Rust has it's own parsers,

Re: Struct field destructor not called when exception is thrown in the main struct destructor

2020-10-17 Thread tchaloupka via Digitalmars-d-learn
On Friday, 16 October 2020 at 16:00:07 UTC, Steven Schveighoffer wrote: On 10/16/20 9:12 AM, tchaloupka wrote: So when the exception is thrown within Foo destructor (and it's bad on it's own but can easily happen as destructors aren't nothrow @nogc by default). Is this behavior expected?

Struct field destructor not called when exception is thrown in the main struct destructor

2020-10-16 Thread tchaloupka via Digitalmars-d-learn
Found a pretty nasty bug in vibe-d: https://github.com/vibe-d/vibe.d/issues/2484 And it's caused by this behavior. ```D import std; struct Foo { Bar bar; bool err; ~this() { // scope(failure) destroy(bar); // < this fixes the Bar destructor call enforce(!err,

Re: HTTP frameworks benchmark focused on D libraries

2020-09-29 Thread tchaloupka via Digitalmars-d-announce
On Monday, 28 September 2020 at 09:44:14 UTC, Daniel Kozak wrote: I do not see TCP_NODELAY anywhere in your code for raw tests, so maybe you should try that I've added new results with these changes: * added NGINX test * edge and level triggered variants for epoll tests (level should be

Re: HTTP frameworks benchmark focused on D libraries

2020-09-27 Thread tchaloupka via Digitalmars-d-announce
Hi all, I've just pushed the updated results. Test suite modifications: * added runner command to list available tests * possibility to switch off keepalive connections - causes `hey` to make a new connection for each request * added parameter to run each test multiple times and choose the

Re: HTTP frameworks benchmark focused on D libraries

2020-09-21 Thread tchaloupka via Digitalmars-d-announce
On Monday, 21 September 2020 at 05:48:54 UTC, Imperatorn wrote: On Sunday, 20 September 2020 at 20:03:27 UTC, tchaloupka wrote: Hi, as it pops up now and then (last one in https://forum.dlang.org/thread/qttjlgxjmrzzuflrj...@forum.dlang.org) I wanted to see the various D libraries performance

HTTP frameworks benchmark focused on D libraries

2020-09-20 Thread tchaloupka via Digitalmars-d-announce
Hi, as it pops up now and then (last one in https://forum.dlang.org/thread/qttjlgxjmrzzuflrj...@forum.dlang.org) I wanted to see the various D libraries performance against each other too and ended up with https://github.com/tchaloupka/httpbench It's just a simple plaintext response testing

Re: std.datetime & timzone specifier: 2018-11-06T16:52:03+01:00

2020-03-08 Thread tchaloupka via Digitalmars-d-learn
On Sunday, 8 March 2020 at 17:28:33 UTC, Robert M. Münch wrote: On 2020-03-07 12:10:27 +, Jonathan M Davis said: DateTime dt = DateTime.fromISOExtString(split("2018-11-06T16:52:03+01:00", regex("\\+"))[0]); IMO such a string should be feedable directly to the function. You just need

Re: SQLite 3 support?

2020-02-26 Thread tchaloupka via Digitalmars-d-learn
On Wednesday, 26 February 2020 at 20:06:20 UTC, mark wrote: There seems to be some support for SQLite 3 in std. lib. etc when looking at the stable docs: https://dlang.org/phobos/etc_c_sqlite3.html But this isn't visible when looking at stable (ddox). Is this the best SQLite 3 library to use

Re: D create many thread

2020-02-06 Thread tchaloupka via Digitalmars-d-learn
On Wednesday, 5 February 2020 at 13:05:59 UTC, Eko Wahyudin wrote: Hi all, I'm create a small (hallo world) application, with DMD. But my program create 7 annoying threads when create an empty class. If you don't want the parallel sweep enabled for your app, you can turn it of ie with:

during: a io_uring wrapper library

2019-12-08 Thread tchaloupka via Digitalmars-d-announce
As of Linux kernel 5.1 new promissing io_uring interface was introduced (see introduction document https://kernel.dk/io_uring.pdf). During[1] is a low level wrapper directly around Linux `io_uring` interface and so isn't using more C-ish liburing[2]. Whole library is built as `nothrow

Re: Calling D library from other languages on linux using foreign threads

2019-03-25 Thread tchaloupka via Digitalmars-d-learn
On Saturday, 23 March 2019 at 17:33:31 UTC, tchaloupka wrote: I've no idea what should be done with C's main thread as it can't be attached because it'll hang. In one of forum threads I've also read the idea to not using foreign threads with GC but somehow delegate their work to D's thread.

Re: Calling D library from other languages on linux using foreign threads

2019-03-23 Thread tchaloupka via Digitalmars-d-learn
On Saturday, 23 March 2019 at 15:28:34 UTC, Ali Çehreli wrote: On 03/22/2019 12:34 PM, tchaloupka wrote: > I've searched a lot at it should be working at least on linux, but > apparently is not or I'm doing something totally wrong.. > > Our use case is to call shared D library from C# (.Net

Re: Shared library loading and static constructor

2019-03-23 Thread tchaloupka via Digitalmars-d-learn
On Saturday, 23 March 2019 at 15:58:07 UTC, Sobaya wrote: What I am saying is that it can not be read when a code importing (a.d) a code including the static constructor (b.d) is compiled into shared library. Hi. I've tried to add your case to the repository and at it seems to be working

Re: Calling D library from other languages on linux using foreign threads

2019-03-23 Thread tchaloupka via Digitalmars-d-learn
On Saturday, 23 March 2019 at 09:47:55 UTC, Andre Pany wrote: On Friday, 22 March 2019 at 19:34:14 UTC, tchaloupka wrote: Just to make sure, could you test it with dmd 2.78? Actually when I remove the explicit GC call within unregistered thread (which is fixed in

Calling D library from other languages on linux using foreign threads

2019-03-22 Thread tchaloupka via Digitalmars-d-learn
I've searched a lot at it should be working at least on linux, but apparently is not or I'm doing something totally wrong.. Our use case is to call shared D library from C# (.Net Core) and from different threads. What I've read about this, is that foreign thread should be registered by

Strange appender behavior

2019-03-13 Thread tchaloupka via Digitalmars-d-learn
Is this expected?: ``` import std.stdio; import std.algorithm; import std.array; void main() { auto d = Appender!string(); //auto d = appender!string(); // works string[] arr = ["foo", "bar", "baz"]; arr.joiner("\n").copy(d); writeln(d.data); } ``` Using Appender outpust

Re: Simple web server benchmark - vibe.d is slower than node.js and Go?

2017-09-25 Thread tchaloupka via Digitalmars-d
On Monday, 25 September 2017 at 13:18:45 UTC, Daniel Kozak wrote: Not at all. Rust test is fake. Does not process headers, does not write headers. Does not send right output. Does not work with browser. Every one or two request it will die. Rust result shoud not be taken seriously. Until

Re: Simple web server benchmark - vibe.d is slower than node.js and Go?

2017-09-25 Thread tchaloupka via Digitalmars-d
On Monday, 25 September 2017 at 08:36:31 UTC, Vadim Lopatin wrote: On Monday, 25 September 2017 at 08:01:02 UTC, tchaloupka wrote: On Monday, 25 September 2017 at 07:05:57 UTC, Vadim Lopatin wrote: On Monday, 25 September 2017 at 06:56:58 UTC, Vadim Lopatin wrote: On Sunday, 24 September 2017

Re: Simple web server benchmark - vibe.d is slower than node.js and Go?

2017-09-25 Thread tchaloupka via Digitalmars-d
On Monday, 25 September 2017 at 07:05:57 UTC, Vadim Lopatin wrote: On Monday, 25 September 2017 at 06:56:58 UTC, Vadim Lopatin wrote: On Sunday, 24 September 2017 at 22:54:11 UTC, Sönke Ludwig wrote: How on earth can that be unfair when the Go, node.js and Scala versions appear to use

Re: Computer Vision Library in D

2016-04-20 Thread tchaloupka via Digitalmars-d-announce
On Wednesday, 20 April 2016 at 19:53:27 UTC, Jacob Carlborg wrote: On 2016-04-20 06:31, Relja Ljubobratovic wrote: I've given this a lot of thought. I use OpenCV daily on the job, and I'm very familiar with it. I too believe it would probably be smarter, faster and safer to wrap its C

Re: Google Summer of Code 2016

2016-01-14 Thread tchaloupka via Digitalmars-d
On Thursday, 14 January 2016 at 18:56:21 UTC, Craig Dillabaugh wrote: On Thursday, 31 December 2015 at 23:58:32 UTC, Craig Dillabaugh wrote: The deadline for the Google Summer of Code, 2016 is February 19th. Which means we have about a month and a half to put something together. For the time

Re: D is on his way to Top 20 in Tiobe

2015-12-13 Thread tchaloupka via Digitalmars-d
On Sunday, 13 December 2015 at 10:21:17 UTC, Ola Fosheim Grøstad wrote: On Saturday, 12 December 2015 at 16:14:34 UTC, JohnCK wrote: Sure, I congratulate too, but what I've said is that I think that maybe D lost it's momentum among other languages back then, in fact I think C++ community was

Re: D is on his way to Top 20 in Tiobe

2015-12-12 Thread tchaloupka via Digitalmars-d
On Friday, 11 December 2015 at 15:29:52 UTC, Ola Fosheim Grøstad wrote: This months top 3: D/PowerNex 29 stars D/DMD 27 stars D/dlangui 13 stars Maybe some interesting stats from github: dmd stars: https://plot.ly/~chalucha/4/stars-vs-month dmd forks:

Re: SysTime bug or feature?

2015-10-06 Thread tchaloupka via Digitalmars-d-learn
On Tuesday, 6 October 2015 at 05:54:44 UTC, Jonathan M Davis wrote: It is by design, albeit undesirable. When SysTime was originally written, it was impossible to have a default value for a class reference other than null. So, unless SysTime was going to take the performance hit of constantly

SysTime bug or feature?

2015-10-05 Thread tchaloupka via Digitalmars-d-learn
This code: import std.stdio; import std.datetime; void main() { SysTime t = SysTime.init; writeln(t); } results in segfault with dmd-2.068.2 Is it ok? Backtrace: #0 0x004733f3 in std.datetime.SysTime.adjTime() const () #1 0x004730b9 in

Contracts with interface

2015-09-19 Thread tchaloupka via Digitalmars-d-learn
This bites me again: import std.stdio; interface ITest { void test(); void test2() in { writeln("itest2"); } void test3() in { writeln("itest3"); } void test4() in { writeln("itest4"); assert(false); } } class Test: ITest { void test() in {

Re: Beta D 2.068.2-b1

2015-09-10 Thread tchaloupka via Digitalmars-d-announce
On Thursday, 10 September 2015 at 03:38:31 UTC, Martin Nowak wrote: Due to a regression in 2.068.1 we'll directly follow up with an unplanned point release 2.068.2. This is the beta for that point release. http://downloads.dlang.org/pre-releases/2.x/2.068.2/ Please test any of your code

Re: Parameterized unittests and benchmarks (aka quickfix + benchmark) PR 2995

2015-09-08 Thread tchaloupka via Digitalmars-d
On Tuesday, 8 September 2015 at 09:20:08 UTC, Robert burner Schadek wrote: On Tuesday, 8 September 2015 at 09:07:10 UTC, Edwin van Leeuwen wrote: Just to be clear. The PR is to add the needed ground work for adding benchmark, or does it also add some benchmarks itself? The PR adds benchmarks

Re: Should this compile?

2015-08-26 Thread tchaloupka via Digitalmars-d-learn
On Tuesday, 25 August 2015 at 18:29:08 UTC, Vladimir Panteleev wrote: I think this is a bug, but is easily worked around with: auto test(string a) { return .test(a, b); } Thanks, this worked. Filled it: https://issues.dlang.org/show_bug.cgi?id=14965

Should this compile?

2015-08-25 Thread tchaloupka via Digitalmars-d-learn
import std.stdio; import std.range : chain; auto test(string a) { return test(a, b); } auto test(string a, string b) { return chain(a, b); } void main() { writeln(test(a)); } Ends with: Error: forward reference to inferred return type of function call 'test' I know this exact

D jwtd library propagated on jwt.io

2015-08-25 Thread tchaloupka via Digitalmars-d-announce
Maybe unnoticed by the community, but thanks to Oleh (olehlong) D is visible as one of implementations of Json web token library on http://jwt.io/. I dont't want to get any credit from this, but not sure if Oleh is on forum so I posted it to let others know. More info about lib is at

Speed of horizontal flip

2015-04-01 Thread tchaloupka via Digitalmars-d-learn
Hi, I have a bunch of square r16 and png images which I need to flip horizontally. My flip method looks like this: void hFlip(T)(T[] data, int w) { import std.datetime : StopWatch; StopWatch sw; sw.start(); foreach(int i; 0..w) { auto row =

Re: Speed of horizontal flip

2015-04-01 Thread tchaloupka via Digitalmars-d-learn
On Wednesday, 1 April 2015 at 14:00:52 UTC, bearophile wrote: tchaloupka: Am I doing something utterly wrong? If you have to perform performance benchmarks then use ldc or gdc. I tried it on my slower linux box (i5-2500K vs i7-2600K) without change with these results: C# (mono with

Re: Speed of horizontal flip

2015-04-01 Thread tchaloupka via Digitalmars-d-learn
On Wednesday, 1 April 2015 at 16:08:14 UTC, John Colvin wrote: On Wednesday, 1 April 2015 at 13:52:06 UTC, tchaloupka wrote: snip I'm pretty sure that the flipping happens in GDI+ as well. You might be writing C#, but the code your calling that's doing all the work is C and/or C++, quite