Thread overview | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 28, 2013 Low-overhead components | ||||
---|---|---|---|---|
| ||||
Not really an article or anything - this was planned as just a post to this newsgroup, but I decided to put it somewhere suitable for larger blocks of text with formatting: http://blog.thecybershadow.net/2013/07/28/low-overhead-components/ |
July 28, 2013 Re: Low-overhead components | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | For a hashtable to know about its container is probably more wasteful than having a pointer to the allocator. If you don't like deep nesting, write a shortcut function, which will do the entire job for you similar to the read function: http://dlang.org/phobos/std_file.html#.read |
July 28, 2013 Re: Low-overhead components | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | On 7/27/13 11:20 PM, Vladimir Panteleev wrote:
> Not really an article or anything - this was planned as just a post to
> this newsgroup, but I decided to put it somewhere suitable for larger
> blocks of text with formatting:
>
> http://blog.thecybershadow.net/2013/07/28/low-overhead-components/
Nice! All - please don't reddit until Monday morning.
Thanks,
Andrei
|
July 28, 2013 Re: Low-overhead components | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | BTW, there's no fast way to boundcheck two-ptr range. It should work similar to opSlice: T opIndex(size_t index) { static if (CHECKED) assert(index < end-ptr); return *(ptr + index); } |
July 28, 2013 Re: Low-overhead components | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On Sunday, 28 July 2013 at 12:31:46 UTC, Kagamin wrote: > For a hashtable to know about its container is probably more wasteful than having a pointer to the allocator. Why? The difference is one indirection. Are you referring to the impact of template bloat and code cache misses? > If you don't like deep nesting, write a shortcut function, which will do the entire job for you similar to the read function: > http://dlang.org/phobos/std_file.html#.read Yes, but you still need to write it. With mixins, each layer is declared separately, and you can access it directly. |
July 28, 2013 Re: Low-overhead components | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On Sunday, 28 July 2013 at 18:51:15 UTC, Kagamin wrote:
> BTW, there's no fast way to boundcheck two-ptr range. It should work similar to opSlice:
>
> T opIndex(size_t index)
> {
> static if (CHECKED)
> assert(index < end-ptr);
> return *(ptr + index);
> }
That's a bug, thanks. But non-release-build performance is not a concern for FastArrayRange anyway.
|
July 29, 2013 Re: Low-overhead components | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | On Sunday, 28 July 2013 at 06:20:29 UTC, Vladimir Panteleev wrote:
> Not really an article or anything - this was planned as just a post to this newsgroup, but I decided to put it somewhere suitable for larger blocks of text with formatting:
>
> http://blog.thecybershadow.net/2013/07/28/low-overhead-components/
BTW, slightly off-topic, but could you clarify something for me? In the phrase "I understand that STL allocators are stateless, which is boring ", does the expression "I understand that" mean "I think the following is true, but I'm not sure" or "I know the following is true, and I acknowledge it, (but...)", or something else?
|
July 29, 2013 Re: Low-overhead components | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | On 7/27/13 11:20 PM, Vladimir Panteleev wrote: > Not really an article or anything - this was planned as just a post to > this newsgroup, but I decided to put it somewhere suitable for larger > blocks of text with formatting: > > http://blog.thecybershadow.net/2013/07/28/low-overhead-components/ Vote up! http://www.reddit.com/r/programming/comments/1jap9d/lowoverhead_components/ Andrei |
July 29, 2013 Re: Low-overhead components | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | On 7/27/2013 11:20 PM, Vladimir Panteleev wrote:
> Not really an article or anything - this was planned as just a post to this
> newsgroup, but I decided to put it somewhere suitable for larger blocks of text
> with formatting:
>
> http://blog.thecybershadow.net/2013/07/28/low-overhead-components/
Please include your name as author on this!
|
July 29, 2013 Re: Low-overhead components | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Monday, 29 July 2013 at 20:08:19 UTC, Walter Bright wrote:
> On 7/27/2013 11:20 PM, Vladimir Panteleev wrote:
>> Not really an article or anything - this was planned as just a post to this
>> newsgroup, but I decided to put it somewhere suitable for larger blocks of text
>> with formatting:
>>
>> http://blog.thecybershadow.net/2013/07/28/low-overhead-components/
>
> Please include your name as author on this!
Fixed, thanks. I wasn't sure if the post was ready for Reddit, as it's mainly some thoughts written down for advanced D users.
|
Copyright © 1999-2021 by the D Language Foundation