|
Boost Users : |
Subject: [Boost-users] Review of Interval Template Library (ITL) for inclusion
From: Jerry Jeremiah (Jerry.Jeremiah_at_[hidden])
Date: 2010-03-04 19:42:04
> Author: Hartmut Kaiser
> Date: 2010-02-19 02:22 +1300
> To: boost, boost-announce, boost-users
> Subject: [boost] [Review] ITL review starts today, February 18th
>
>
> Hi all,
>
> The formal review of the Interval Template Library (ITL) starts today,
> February 18th, 2010 and will end February 27th, 2010.
> ITL is being developed by Joachim Faulhaber.
>
> ------------------------------------------------
>
> Everybody on this list is invited to participate in this formal review. I
> hope to see your review of this library, including your vote, and I welcome
> your participation in the discussions on the Boost mailing list.
>
> Please always state in your review, whether you think the library should be
> accepted as a Boost library.
>
> Additionally, please consider giving feedback on the following general
> topics:
>
> - What is your evaluation of the design?
> - What is your evaluation of the implementation?
> - What is your evaluation of the documentation?
> - What is your evaluation of the potential usefulness of the library?
> - Did you try to use the library? With what compiler?
> Did you have any problems?
> - How much effort did you put into your evaluation? A glance?
> A quick reading? In-depth study?
> - Are you knowledgeable about the problem domain?
>
>
> Regards Hartmut
> Review Manager
>
Firstly, I want to say that I have never participated in a review before so hopefully I can meet expectations for a good quality review. And let me also say, I am really glad that the review period was extended - I just don't have time to get onto something specific within a week.
This review wasn't really an academic exercise for me. This library has a practical use for me so this review is a by-product of my attempt to see how using the library would compare with what I would have to hand write to get the same result. I work for a telecom and we have call detail records for millions of calls per day. What I want to know is how many simultaneous phone calls are there at any point in time. Traditionally, one would make an integer array of 7 days x 86400 seconds to hold the number of calls for each second in the week and then increment all the seconds between the start and end time of each call. With this library one simply inserts into an interval map the start and end times of the calls and then iterates through the map printing out the results.
I read all the documentation twice. The first time didn't really make it clear how all the possible options related to each other and in what circumstances I would use each of them. But the second reading really helped. The examples in the documentation (like Table 1.3) were useful to my understanding. I thought the documentation was quite comprehensive and I really appreciated that - an example of that is Table 1.12 which I mention later on.
The thing that differentiates a library from something I would write is that a library must cater for every single possible use. I thought the author went to a lot of effort to do this and the number of combinations of sets and maps that the library supports far exceeds the number of different use cases I have.
The code samples helped clarify the differences between the different options. I didn't see an example where split_interval_map gave a result that was more useful than that of the interval_map. When would not joining touching intervals with the same value be the desired outcome? I guess the "time grid" could be such an example but it didn't use interval maps.
I am not a meta-programming guru so looking at the source for Proto, MPL or Fusion just confuses me and I try to avoid that at all costs. I was a bit scared to look at the source for this library, but I put on a brave face and had a peek. It wasn't all that scary after all - it was quite readable. The source reminds me a lot like the STL headers which I guess isn't that surprising since it is implementing similar style containers (map and set).
In the Party example a boost::itl::set<string> is used to store the names of the guests because it supports += as set union. In that example you can just as easily use: struct GuestSetT : public std::set<string> { std::set<string> & operator += (const std::set<string> & right) { insert(right.begin(), right.end()); return *this; }}; My question is, does this example really benefit from using itl::set? I do see value in itl::set and itl::map on their own but except this one use there aren't any examples that show why they would suit a particular application.
I played with all the examples without any problem and I made a couple of my own. The library handled my example use cases elegantly although I certainly never did anything complicated enough to test the limits of the library. I used MSVC 2005 on Windows XP. There just wasn't time to try a full test with millions of phone calls spread over several days so I don't really have any idea how the performance compares to anything - I am depending on the table in the documentation (Table 1.12) for those answers.
I was a bit concerned about the questions raised by http://comments.gmane.org/gmane.comp.lib.boost.devel/199902 - I did notice the disclaimer in the documentation saying that an interval_map of sets is a bad idea but maybe that should be explained more explicitly under the complexity topic.
>From my point of view, the library has practical uses. I found the library easy to use because the documentation was comprehensive and the examples covered my use cases. I don't really understand how
I think it would make a good addition to boost and so my vote is yes.
Jerry Jeremiah
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net