Re: More zero-initialization optimizations pending in std.experimental.allocator?

2018-10-20 Thread Nathan S. via Digitalmars-d
On Friday, 19 October 2018 at 21:29:42 UTC, Per Nordlöw wrote: Now that https://github.com/dlang/phobos/pull/6411 has been merged and DMD stable soon has the new __traits(isZeroInit, T) found here https://dlang.org/changelog/2.083.0.html#isZeroInit are there more zero-initializa

Re: D hash table comparison benchmark

2018-06-25 Thread Nathan S. via Digitalmars-d
Benchmark code: dub.sdl ``` name "hashbench" description "D hashtable comparison." dependency "emsi_containers" version="~>0.7.0" dependency "memutils" version="~>0.4.11" dependency "vibe-d:utils" version="~>0.8.4" dependency "jive" version="~>0.2.0" //dependency "collections" version="~>0.1.0" /

D hash table comparison benchmark

2018-06-25 Thread Nathan S. via Digitalmars-d
The below benchmarks come from writing 100 int-to-int mappings to a new hashtable then reading them back, repeated 10_000 times. The built-in AA doesn't deallocate memory when it falls out of scope but the other maps do. Benchmark code in next post. == Speed Ranking using LDC2 (optimized) ==

Re: D hash table comparison benchmark

2018-06-25 Thread Nathan S. via Digitalmars-d
With LDC2 the times for vibe.utils.hashmap and memutils.hashmap are suspiciously low, leading me to suspect that the optimizer might be omitting most of the work. Here are the figures without optimizations enabled. == Speed Ranking using DMD (no optimizations) == 95 msecs built-in AA 168 msec

Re: Disappointing performance from DMD/Phobos

2018-06-25 Thread Nathan S. via Digitalmars-d
On Tuesday, 26 June 2018 at 02:20:37 UTC, Manu wrote: I optimised another major gotcha eating perf, and now this issue is taking 13% of my entire work time... bummer. Without disagreeing with you, ldc2 optimizes this fine. https://run.dlang.io/is/NJct6U const @property uint onlineapp.Enti

Re: D hash table comparison benchmark

2018-06-25 Thread Nathan S. via Digitalmars-d
On Tuesday, 26 June 2018 at 03:45:27 UTC, Seb wrote: Did you by chance also benchmark it with other languages like C++, Go or Rust? I didn't since I was evaluating hashtable implementations for use in a D application. BTW I'm not sure what your plans are, but are you aware of this recent ar

Re: D hash table comparison benchmark

2018-06-26 Thread Nathan S. via Digitalmars-d
BTW the output is formatted so you can get a sorted list of times across all trials by piping the output through `sort -n`. That's also why the tests reusing maps start with ( instead of [, so they will be grouped separately.

Re: D hash table comparison benchmark

2018-06-26 Thread Nathan S. via Digitalmars-d
On Tuesday, 26 June 2018 at 14:33:25 UTC, Eugene Wissner wrote: Tanya hashes any value, also integral types; other hashtables probably not. Your intuition is correct here. Most of the tables use `typeid(key).getHash(&key)`, which for `int` just returns `key`. = Built-in AA = General case: `t

Re: D hash table comparison benchmark

2018-06-27 Thread Nathan S. via Digitalmars-d
On Tuesday, 26 June 2018 at 03:45:27 UTC, Seb wrote: Did you by chance also benchmark it with other languages like C++, Go or Rust? = Not reusing hashtables, optimizations enabled = 79 msecs Rust std::collections::HashMap 90 msecs Go built-in map 177 msecs C++ std::unordered_map (whichever impl

Re: Weird bugs in DMD 2.81.0

2018-07-09 Thread Nathan S. via Digitalmars-d
On Monday, 9 July 2018 at 19:31:52 UTC, Steven Schveighoffer wrote: FYI there have been a lot of recent changes on druntime that have to do with hashing. It's possible something changed that affects you. None of the recent changes ought to affect `ushort[string]` since it hashes its keys usin

Re: My two cents

2017-10-23 Thread Nathan S. via Digitalmars-d
On Monday, 23 October 2017 at 22:22:55 UTC, Adam Wilson wrote: Additionally, MSFT/C# fully recognizes that the benefits of Async/Await have never been and never were intended to be for performance. Async/Await trades raw performance for an ability to handle a truly massive number of simultaneou

Re: Project Elvis

2017-11-10 Thread Nathan S. via Digitalmars-d
On Monday, 6 November 2017 at 12:25:06 UTC, Biotronic wrote: I find I often use this in C# with a more complex expression on the left-hand side, like a function call. A quick search shows more than 2/3 of my uses are function calls or otherwise significantly more complex than a variable. Also,

Re: Time to move logger from experimental to std ?

2017-11-29 Thread Nathan S. via Digitalmars-d
On Wednesday, 29 November 2017 at 14:32:54 UTC, Basile B. wrote: - There only 4 issues for logger Considering that one of those issues is that the logger outputs garbage when given a wstring or a dstring, I would not take this as an indication that it's time to "graduate" the logger from exp

Re: Time to move logger from experimental to std ?

2017-11-30 Thread Nathan S. via Digitalmars-d
On Thursday, 30 November 2017 at 09:37:27 UTC, Robert burner Schadek wrote: On Wednesday, 29 November 2017 at 19:48:44 UTC, Nathan S. wrote: Considering that one of those issues is that the logger outputs garbage when given a wstring or a dstring, I would not take this as an indication that it'

wut: std.datetime.systime.Clock.currStdTime is offset from Jan 1st, 1 AD

2018-01-23 Thread Nathan S. via Digitalmars-d
https://dlang.org/phobos/std_datetime_systime.html#.Clock.currStdTime """ @property @trusted long currStdTime(ClockType clockType = ClockType.normal)(); Returns the number of hnsecs since midnight, January 1st, 1 A.D. for the current time. """ This choice of offset seems Esperanto-like: delibe

Re: Thread safe reference counting

2018-02-06 Thread Nathan S. via Digitalmars-d
On Saturday, 3 February 2018 at 14:41:06 UTC, Kagamin wrote: That RCSharedAllocator PR made me think, so this is my take on how to keep reference counted allocator in shared storage: https://run.dlang.io/is/r1z1dd You might also want to look at Atila Neves's automem package. It uses atomic in

Re: Bye bye, fast compilation times

2018-02-06 Thread Nathan S. via Digitalmars-d
On Tuesday, 6 February 2018 at 06:11:55 UTC, Dmitry Olshansky wrote: On Tuesday, 6 February 2018 at 05:45:35 UTC, Steven Schveighoffer wrote: On 2/6/18 12:35 AM, Dmitry Olshansky wrote: That’s really bad idea - isEmail is template so the burden of freaking slow ctRegex is paid on per instanti

Re: Bye bye, fast compilation times

2018-02-07 Thread Nathan S. via Digitalmars-d
On Tuesday, 6 February 2018 at 22:29:07 UTC, Walter Bright wrote: nobody uses regex for lexer in a compiler. Some years ago I was surprised when I saw this in Clojure's source code. It appears to still be there today: https://github.com/clojure/clojure/blob/1215ba346ffea3fe48def6ec70542e3300

Re: Heads-up: upcoming instabilities in std.experimental.allocator, and what to do

2018-02-08 Thread Nathan S. via Digitalmars-d
On Thursday, 30 November 2017 at 19:01:02 UTC, Andrei Alexandrescu wrote: So we may switch to ubyte[] Hooray!

Re: Bye bye, fast compilation times

2018-02-11 Thread Nathan S. via Digitalmars-d
On Wednesday, 7 February 2018 at 08:21:01 UTC, Seb wrote: There's `version(StdUnittest)` since a few days And I've just submitted a pull request that adds `version(StdUnittest)` to every unittest in the standard library. https://github.com/dlang/phobos/pull/6159

Re: New abstraction: Layout

2018-02-19 Thread Nathan S. via Digitalmars-d
On Saturday, 17 February 2018 at 12:49:07 UTC, Andrei Alexandrescu wrote: On 02/16/2018 10:10 PM, rikki cattermole wrote: Could use the name for the field as well. At the minimum useful for debugging purposes. That would be tricky because fields are decomposed down to primitive types. -- Andr

Re: Is the following well defined and allowed?

2018-03-01 Thread Nathan S. via Digitalmars-d
On Thursday, 1 March 2018 at 21:01:08 UTC, Steven Schveighoffer wrote: Yeah, it seems like -noboundscheck should never be used. How good is DMD at omitting redundant bounds checks? I assume not much engineering effort has been put towards that due to "-boundscheck=off" being available.