digitalmars.D - Simplifying druntime and phobos by getting rid of "shared static
- Andrei Alexandrescu (4/4) May 23 2017 https://github.com/dlang/phobos/pull/5421
- David Nadlinger (5/6) May 23 2017 How detailed are your plans for this? The interaction between GC
- Andrei Alexandrescu (3/8) May 23 2017 Not too detailed, and that why I'm counting for experts such as
- Andrei Alexandrescu (2/7) May 23 2017 In the same vein: https://github.com/dlang/phobos/pull/5423 -- Andrei
- Steven Schveighoffer (3/10) May 24 2017 This one I 100% agree with!
- Steven Schveighoffer (10/14) May 24 2017 So every time I do:
- Stanislav Blinov (3/15) May 24 2017 It also copies every argument four times.
- Andrei Alexandrescu (15/29) May 24 2017 Always a good idea. My test bed:
- Steven Schveighoffer (8/37) May 24 2017 OK, I worry about inlineability as DMD has issues when you are using
- Andrei Alexandrescu (2/2) May 24 2017 BTW the best outcome of this is a faster initOnce. Steve, take a look at...
https://github.com/dlang/phobos/pull/5421 Looking forward to more in the same vein, please contribute! We have 25 left in phobos and 12 in druntime. A big one will be making the GC lazily initialize itself. -- Andrei
May 23 2017
On Tuesday, 23 May 2017 at 19:47:49 UTC, Andrei Alexandrescu wrote:A big one will be making the GC lazily initialize itself.How detailed are your plans for this? The interaction between GC and shared library loading is a bit non-trivial to get right. — David
May 23 2017
On 05/23/2017 04:34 PM, David Nadlinger wrote:On Tuesday, 23 May 2017 at 19:47:49 UTC, Andrei Alexandrescu wrote:Not too detailed, and that why I'm counting for experts such as yourself. -- AndreiA big one will be making the GC lazily initialize itself.How detailed are your plans for this? The interaction between GC and shared library loading is a bit non-trivial to get right. — David
May 23 2017
On 05/23/2017 03:47 PM, Andrei Alexandrescu wrote:https://github.com/dlang/phobos/pull/5421 Looking forward to more in the same vein, please contribute! We have 25 left in phobos and 12 in druntime. A big one will be making the GC lazily initialize itself. -- AndreiIn the same vein: https://github.com/dlang/phobos/pull/5423 -- Andrei
May 23 2017
On 5/23/17 4:42 PM, Andrei Alexandrescu wrote:On 05/23/2017 03:47 PM, Andrei Alexandrescu wrote:This one I 100% agree with! -Stevehttps://github.com/dlang/phobos/pull/5421 Looking forward to more in the same vein, please contribute! We have 25 left in phobos and 12 in druntime. A big one will be making the GC lazily initialize itself. -- AndreiIn the same vein: https://github.com/dlang/phobos/pull/5423 -- Andrei
May 24 2017
On 5/23/17 3:47 PM, Andrei Alexandrescu wrote:https://github.com/dlang/phobos/pull/5421 Looking forward to more in the same vein, please contribute! We have 25 left in phobos and 12 in druntime. A big one will be making the GC lazily initialize itself. -- AndreiSo every time I do: writeln(...) It has to go through a check to see if it's initialized? Using a delegate? Has the performance of this been tested? I agree the stdiobase thing is ugly. We could also fix this by improving the cycle detection mechanism (e.g. you could tag the static ctor that initializes the handles to say it doesn't depend on any other static ctors, and just put it in stdio). -Steve
May 24 2017
On Wednesday, 24 May 2017 at 15:49:58 UTC, Steven Schveighoffer wrote:On 5/23/17 3:47 PM, Andrei Alexandrescu wrote:It also copies every argument four times.https://github.com/dlang/phobos/pull/5421 Looking forward to more in the same vein, please contribute! We have 25 left in phobos and 12 in druntime. A big one will be making the GC lazily initialize itself. -- AndreiSo every time I do: writeln(...) It has to go through a check to see if it's initialized? Using a delegate?
May 24 2017
On 5/24/17 4:49 PM, Steven Schveighoffer wrote:On 5/23/17 3:47 PM, Andrei Alexandrescu wrote:The delegate is not called in the steady state.https://github.com/dlang/phobos/pull/5421 Looking forward to more in the same vein, please contribute! We have 25 left in phobos and 12 in druntime. A big one will be making the GC lazily initialize itself. -- AndreiSo every time I do: writeln(...) It has to go through a check to see if it's initialized? Using a delegate?Has the performance of this been tested?Always a good idea. My test bed: void main() { import std.stdio; foreach (i; 0 .. 10_000_000) writeln("1234567890"); } On my laptop using dmd, phobos master, best of 21 runs using "time test/dev/null": 1.371 seconds.With initOnce: 1.469 seconds. Yuck! So I added double checking: https://github.com/dlang/phobos/pull/5421/commits/6ef3b5a6eacfe82239b7bbc4b0bc9f38adc6fe91 With the double checking: 1.372 seconds. So back to sanity. Thanks for asking me to measure! Andrei
May 24 2017
On 5/24/17 12:40 PM, Andrei Alexandrescu wrote:On 5/24/17 4:49 PM, Steven Schveighoffer wrote:OK, I worry about inlineability as DMD has issues when you are using delegates sometimes. Unfortunately, I think the compiler isn't smart enough to realize that after one check of the boolean returns true, it could just access the File handle directly.On 5/23/17 3:47 PM, Andrei Alexandrescu wrote:The delegate is not called in the steady state.https://github.com/dlang/phobos/pull/5421 Looking forward to more in the same vein, please contribute! We have 25 left in phobos and 12 in druntime. A big one will be making the GC lazily initialize itself. -- AndreiSo every time I do: writeln(...) It has to go through a check to see if it's initialized? Using a delegate?This is pretty decent. I still prefer the static ctor solution, but this is workable. -SteveHas the performance of this been tested?Always a good idea. My test bed: void main() { import std.stdio; foreach (i; 0 .. 10_000_000) writeln("1234567890"); } On my laptop using dmd, phobos master, best of 21 runs using "time test/dev/null": 1.371 seconds.With initOnce: 1.469 seconds. Yuck! So I added double checking: https://github.com/dlang/phobos/pull/5421/commits/6ef3b5a6eacfe82239b7bbc4b0bc9f38adc6fe91 With the double checking: 1.372 seconds. So back to sanity. Thanks for asking me to measure!
May 24 2017
BTW the best outcome of this is a faster initOnce. Steve, take a look at it pliz pliz? -- Andrei
May 24 2017