[LLVMdev] std::string

Daniel Berlin dberlin at dberlin.org
Mon Jan 21 06:42:26 PST 2013

On Mon, Jan 21, 2013 at 8:08 AM, Krzysztof Parzyszek
<kparzysz at codeaurora.org> wrote:
> On 1/21/2013 12:35 AM, Chris Lattner wrote:
>> I'm confused here.  You're acting as though we don't use the STL.  In
>> fact, we do use std::string, std::vector, std::map etc when they are the
>> right solution for the job.
> I'm trying to understand the reasoning behind the decisions made at the
> beginning of LLVM.  My working assumption is that ADT didn't exist when LLVM
> started (whereas STL did).  In such case, I'm assuming that creation of ADT
> was motivated by needs of LLVM that STL didn't meet. I'm trying to
> understand what the needs were and where STL was considered inadequate.
> Creating a new set of containers is an investment, so, again, I'm assuming
> that there were specific motives that caused that investment to be made.

> Benjamin's answer was actually very informative, that was that kind of
> information I was looking for.

You can actually see what happened if you look back far enough in the
mailing list:

One common idiom was:

Someone saw that X and Y optimization passes were slow
They determined the slowness was in the containers
The containers turned out to be slow on all platforms
New containers were implemented
They made real world significant differences in speed on all platforms
The new containers were used.

The alternative would have been to try to get patches into multiple
STL's, and then tell everyone in the world to upgrade.  IE "Oh, LLVM
is slow if you are on GCC 4.3.6, you need 4.3.7, or MSVC 2012, or XLC
11.9 or  ...".

Every so often someone determines some optimization pass is still
using XX percent of time in a container, they test various containers,
discover that either it's faster or slower than other alternatives,
and LLVM adjusts accordingly.

More information about the llvm-dev mailing list