Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

should i use tango

Posted: 10/30/08 07:00:32

im in the middle of development of custom search engine. currently im relying on phobos but most of my codes are using std.c libraries. recently i was browsing the tango api docs and stumble across few features not available in phobos such as array functions and VFS which seems interesting. But i favor performance over bulky features, so should i migrate the codes done so far to tango for the sake of these neat functions or stick to phobos.

Author Message

Posted: 10/30/08 09:43:46

Hi kar!

Hopefully Tango's features aren't bulky (we try to avoid that), although Tango have many more features than Phobos. In fact, if Tango is decidedly slower than Phobos in anything, then it is a Tango bug, but in general all tests show Tango to be faster (XML and Regex in order of magnitudes, IO by a large margin).

All-in-all, I think you would gain a lot by using Tango for a search engine, as Tango also have very efficient string routines.

Posted: 10/30/08 10:17:52 -- Modified: 10/30/08 10:28:49 by
kar -- Modified 2 Times

thanks a lot larsivi, im seriously considering to migrate to tango but that if the process is not time consuming.

just fyi, i did ask the same question months ago on D newsgroup and like 90% of them suggest phobos as they claimed it faster than tango. Im doing traditional modular approach with some structs, no classes as i was a C programmer before.

1 last question, im using D 1.0 but im curious if Tango 2.0 going to ditch tango 1.0 in term of new features like phobos did, if so should i use migrate to D2.0 as well in favor of tango 2.0?

Posted: 10/30/08 11:14:51

kar wrote:

thanks a lot larsivi, im seriously considering to migrate to tango but that if the process is not time consuming.

just fyi, i did ask the same question months ago on D newsgroup and like 90% of them suggest phobos as they claimed it faster than tango.

I'm afraid I missed that post, but you have been seriously misguided if that truly is the case.

kar wrote:

Im doing traditional modular approach with some structs, no classes as i was a C programmer before.

It is a misunderstanding that encapsulation in itself cause programs to be slower - as it is, most of the free standing functions in Phobos cause many more memory allocations than the classes in Tango. Low memory footprint is the biggest reason for Tango being as fast as it is. The cluster package (which makes fair use of other parts of Tango) can for instance receive and send tens of thousand messages per second while barely registering on the computer memory graphs.

However, it is also a misunderstanding that Tango is class based, as it has many free functions, and uses structs in many places.

kar wrote:

1 last question, im using D 1.0 but im curious if Tango 2.0 going to ditch tango 1.0 in term of new features like phobos did, if so should i use migrate to D2.0 as well in favor of tango 2.0?

Tango for D2 will not be Tango 2.0 in the same way Phobos 2.0 is for D2, and neither is Tango 2.0 really on the roadmap yet (1.0 isn't released) - so I don't think the question is relevant for Tango. Currently there are no plans to put new features into Tango for D2.0 over Tango for D1.0 either, this is more likely to happen via later versions of Tango dropping support for D1.0. But D2.0 is still at least 6 months from being stable, so it really is impossible to say.

Posted: 10/30/08 11:26:38

Thanks again for clearing things up.