Useful programming links
-
- Elite
- Posts: 8014
- Joined: Fri Sep 05, 2003 4:03 am
- Location: Montreal
- Contact:
Useful programming links
C++ Idioms on Wikibooks
Fast Pimpl Implementation with array allocators and the works!
Contemplation mandala:
g++ -Wall -Wextra -pedantic -Werror
Perhaps that day will come...
"True Typedefs" (article in Dr.Dobb's, March 2003
The article that apparently inspired the shrink-wrapped BOOST solution right below.
BOOST_STRONG_TYPEDEF(T,D) page
BOOST_STRONG_TYPEDEF(T,D) code
BOOST Units Library
"With appropriate compiler optimization, no runtime execution cost is introduced, facilitating the use of this library to provide dimension checking in performance-critical code"
Optimizing software in C++: An optimization guide for Windows, Linux and Mac platforms
SSE Instruction Set (plus MMX, SSE2, SSE3, etceteras)
Introductory tutorial to SSE coding
Gustavo Oliviera's SIMD 3D Vector Library --at Gamasutra
Cross-platform SIMD C Headers --Sourceforge webpage
Cross-platform SIMD C Headers --download link at Sourceforge
Fast Pimpl Implementation with array allocators and the works!
Contemplation mandala:
g++ -Wall -Wextra -pedantic -Werror
Perhaps that day will come...
"True Typedefs" (article in Dr.Dobb's, March 2003
The article that apparently inspired the shrink-wrapped BOOST solution right below.
BOOST_STRONG_TYPEDEF(T,D) page
BOOST_STRONG_TYPEDEF(T,D) code
BOOST Units Library
"With appropriate compiler optimization, no runtime execution cost is introduced, facilitating the use of this library to provide dimension checking in performance-critical code"
Optimizing software in C++: An optimization guide for Windows, Linux and Mac platforms
SSE Instruction Set (plus MMX, SSE2, SSE3, etceteras)
Introductory tutorial to SSE coding
Gustavo Oliviera's SIMD 3D Vector Library --at Gamasutra
Cross-platform SIMD C Headers --Sourceforge webpage
Cross-platform SIMD C Headers --download link at Sourceforge
Latest version of Cinemut Opaque
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
-
- Confed Special Operative
- Posts: 349
- Joined: Thu Jan 05, 2006 12:43 am
- Location: /stray/
- Contact:
Re: Useful programming links
Thanks for collecting these resources.
-
- Elite
- Posts: 8014
- Joined: Fri Sep 05, 2003 4:03 am
- Location: Montreal
- Contact:
Re: Useful programming links
Hey, Snow_Cat; been a while. My pleasure; I'm doing this for selfish reasons; so I don't lose the links.
Here's a brilliant piece:
Idioms for Typesafe Enums in C++ --by Martin Buchholz
I'm thinking of trying to come up with an enum macro and templates that allows you to declare
an enum=based switch statement that caches the last switch used, so that if the switch argument
would be the same it goes there directly, rather than go through the switch (computed goto). This would
speed-up the runtime in many places. For instance, VDU mode rarely changes (user changes it); but at
each iteration of VDU::draw() there's a switch statement with all modes as cases to go through.
I might use the code above and modify it to add the switch and last-used-cache-ing.
Here's a brilliant piece:
Idioms for Typesafe Enums in C++ --by Martin Buchholz
I'm thinking of trying to come up with an enum macro and templates that allows you to declare
an enum=based switch statement that caches the last switch used, so that if the switch argument
would be the same it goes there directly, rather than go through the switch (computed goto). This would
speed-up the runtime in many places. For instance, VDU mode rarely changes (user changes it); but at
each iteration of VDU::draw() there's a switch statement with all modes as cases to go through.
I might use the code above and modify it to add the switch and last-used-cache-ing.
Latest version of Cinemut Opaque
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
Re: Useful programming links
That's nonsense. The CPU already tracks the last target efficiently enough (the branch target buffer).chuck_starchaser wrote:I'm thinking of trying to come up with an enum macro and templates that allows you to declare
an enum=based switch statement that caches the last switch used, so that if the switch argument
would be the same it goes there directly, rather than go through the switch (computed goto). This would
speed-up the runtime in many places. For instance, VDU mode rarely changes (user changes it); but at
each iteration of VDU::draw() there's a switch statement with all modes as cases to go through.
I might use the code above and modify it to add the switch and last-used-cache-ing.
The problem is with unpredictable (by BTB means) change patterns. Imagine the target changes every other execution or something like that.
-
- Elite
- Posts: 8014
- Joined: Fri Sep 05, 2003 4:03 am
- Location: Montreal
- Contact:
Re: Useful programming links
I've never read about cpu's cacheing the targets of computed goto's, which is what switch statements often get compiled to;
but it could be there is such a thing and I never heard about it. What I know cpu's have is a branch prediction cache, which
is indexed by the address of the branch instruction. In a case statement based on enums, the compiler produces an array
of goto's preceded by an operation that adds some k*SwitchArg to the program counter. What would the cpu index its branch
prediction to, in such a case? Or does it have a separate "computed goto cache"?
but it could be there is such a thing and I never heard about it. What I know cpu's have is a branch prediction cache, which
is indexed by the address of the branch instruction. In a case statement based on enums, the compiler produces an array
of goto's preceded by an operation that adds some k*SwitchArg to the program counter. What would the cpu index its branch
prediction to, in such a case? Or does it have a separate "computed goto cache"?
Latest version of Cinemut Opaque
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
Re: Useful programming links
Well, there's a similar predictive cache that caches branch targets. It was introduced, AFAIK, in the netburst architecture and it sped up dynamic code a lot, like that of VMs (JVM, python, virtual calls in C++, indirect calls in C, etc).
-
- Elite
- Posts: 8014
- Joined: Fri Sep 05, 2003 4:03 am
- Location: Montreal
- Contact:
Re: Useful programming links
Gottcha.
Latest version of Cinemut Opaque
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
-
- Venturer
- Posts: 537
- Joined: Sat May 14, 2005 10:51 am
- Location: milkyway->the sol system->earth->Europe->The Nederland->Soud Holland->Leiden
- Contact:
-
- Elite
- Posts: 8014
- Joined: Fri Sep 05, 2003 4:03 am
- Location: Montreal
- Contact:
Re: Useful programming links
Excellent! Thanks! I'll keep adding any good links I come across.
Latest version of Cinemut Opaque
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
-
- Elite
- Posts: 8014
- Joined: Fri Sep 05, 2003 4:03 am
- Location: Montreal
- Contact:
Re: Useful programming links
Allocators, allocators...
A couple of years ago, Boost had a fast block allocator, and a half-baked multithreading library; and I put the two together and made a per-thread block allocator, super-fast.
I don't remember where the code would be, but it doesn't matter, as Boost has come up with a brand new multithreading library; and now that I'm looking for its fast block allocator I can't find it... But I'm finding useful links, anyways:
Fast allocations and deallocations --on Wikibooks
FSB Allocator
FOUND IT!
Boost Pool Allocator
Boost Pool Interfaces
I'll have a closer look tonight. I like the FSB allocator because it is NOT thread-safe, and therefore a lot faster. Not sure whether the boost one is, or isn't. I could re-implement the per-thread pool allocator, even if we don't have threads yet, just for scalability.
A couple of years ago, Boost had a fast block allocator, and a half-baked multithreading library; and I put the two together and made a per-thread block allocator, super-fast.
I don't remember where the code would be, but it doesn't matter, as Boost has come up with a brand new multithreading library; and now that I'm looking for its fast block allocator I can't find it... But I'm finding useful links, anyways:
Fast allocations and deallocations --on Wikibooks
FSB Allocator
FOUND IT!
Boost Pool Allocator
Boost Pool Interfaces
I'll have a closer look tonight. I like the FSB allocator because it is NOT thread-safe, and therefore a lot faster. Not sure whether the boost one is, or isn't. I could re-implement the per-thread pool allocator, even if we don't have threads yet, just for scalability.
Latest version of Cinemut Opaque
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
Latest version of LaGrande noodleworks (scroll down).
An evolving La Grande How-To...
The non-working, but latest, CineMut test_bike
PU (Privateer: Parallel Universe's Home). WC or Privateer Drayman for you?
WCpedia --The Wing Commander Encyclopedia-- From Angel Deveraux through Belisarius to Zachary Banfeld...
WC Nexus forum, the Moonbase Tycho of WC fans.
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina