* [Cake] RFC: allocate without the gotos
@ 2017-11-26 9:54 Kevin Darbyshire-Bryant
2017-11-26 10:00 ` Jonathan Morton
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Darbyshire-Bryant @ 2017-11-26 9:54 UTC (permalink / raw)
To: Cake List
Hi All,
If anyone is brave I’ve just done a commit with the src/dst host allocate stuff minus the gotos. Not even compile tested! Woke up with it in my head. I’m not convinced it’s really cleaner, absolutely no idea if it’s faster. But it’s here with all sorts of major caveats :-)
https://github.com/dtaht/sch_cake/pull/76/commits/4b9d7cc436daed4b0fac00f2ff2ae185798e5f6c
Kevin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Cake] RFC: allocate without the gotos
2017-11-26 9:54 [Cake] RFC: allocate without the gotos Kevin Darbyshire-Bryant
@ 2017-11-26 10:00 ` Jonathan Morton
2017-11-26 10:03 ` Kevin Darbyshire-Bryant
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Morton @ 2017-11-26 10:00 UTC (permalink / raw)
To: Kevin Darbyshire-Bryant; +Cc: Cake List
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
On a purely theoretical basis, it probably isn't as fast, because now the
'found' condition has to be tested multiple times on the fast and slow
paths alike. Only if the compiler is smart enough to transform it back the
way it was...
...and IMHO the goto version is easier to read too.
- Jonathan Morton
[-- Attachment #2: Type: text/html, Size: 379 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Cake] RFC: allocate without the gotos
2017-11-26 10:00 ` Jonathan Morton
@ 2017-11-26 10:03 ` Kevin Darbyshire-Bryant
2017-11-26 18:19 ` Dave Taht
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Darbyshire-Bryant @ 2017-11-26 10:03 UTC (permalink / raw)
To: Jonathan Morton; +Cc: Cake List
> On 26 Nov 2017, at 10:00, Jonathan Morton <chromatix99@gmail.com> wrote:
>
> On a purely theoretical basis, it probably isn't as fast, because now the 'found' condition has to be tested multiple times on the fast and slow paths alike. Only if the compiler is smart enough to transform it back the way it was…
It was done as a ‘for sh*ts’n’giggles’ exercise….which is probably why I haven’t even tried compiling it :-)
>
> ...and IMHO the goto version is easier to read too.
I definitely agree with that!
>
> - Jonathan Morton
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Cake] RFC: allocate without the gotos
2017-11-26 10:03 ` Kevin Darbyshire-Bryant
@ 2017-11-26 18:19 ` Dave Taht
0 siblings, 0 replies; 4+ messages in thread
From: Dave Taht @ 2017-11-26 18:19 UTC (permalink / raw)
To: Kevin Darbyshire-Bryant; +Cc: Jonathan Morton, Cake List
Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk> writes:
>> On 26 Nov 2017, at 10:00, Jonathan Morton <chromatix99@gmail.com> wrote:
>>
>> On a purely theoretical basis, it probably isn't as fast, because now the
>> 'found' condition has to be tested multiple times on the fast and slow paths
>> alike. Only if the compiler is smart enough to transform it back the way it
>> was…
> It was done as a ‘for sh*ts’n’giggles’ exercise….which is probably why I haven’t even tried compiling it :-)
>>
>> ...and IMHO the goto version is easier to read too.
> I definitely agree with that!
gotos we stick with, then.
>>
>> - Jonathan Morton
>
>
> _______________________________________________
> Cake mailing list
> Cake@lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/cake
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-26 18:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-26 9:54 [Cake] RFC: allocate without the gotos Kevin Darbyshire-Bryant
2017-11-26 10:00 ` Jonathan Morton
2017-11-26 10:03 ` Kevin Darbyshire-Bryant
2017-11-26 18:19 ` Dave Taht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox