(Thorny issue, I hope Ann Harrison will comment.)

Hello, currently the engine supports BLR4 (legacy) and BLR 5. All FB
versions generate BLR 5. But we are hitting some limits and I think we
should increase it again (this would be for the first time for FB). Dmitry
asked me to get rid of the 255 streams limit but what I did is only the
starting point.

Problematic places that I marked in the code:

ExprNodes.cpp:
        // CVC: bottleneck
        const StreamType streamCount = csb->csb_blr_reader.getByte();

        for (StreamType i = 0; i < streamCount; ++i)
        {
                const USHORT n = csb->csb_blr_reader.getByte();
                node->internalStreamList.add(csb->csb_rpt[n].csb_stream);
        }

Number of streams is limited to 255, despite me lifting the restrictions in
other places.

Again, ExprNodes.cpp, this looks like the complementary part:
        // bottleneck
        fb_assert(stack.object()->ctx_context <= MAX_UCHAR);
        dsqlScratch->appendUChar(stack.object()->ctx_context);

RecordSourceNodes.cpp
        // bottleneck
        int count = (unsigned int) csb->csb_blr_reader.getByte();
        // Pick up the sub-RseNode's and maps.
        while (--count >= 0)

There may be other places I'm not aware of. The important idea is that BLR
is expected to hold those values in single bytes and this is not enough
anymore. I see raising the BLR version as the only solution.

Things we can do in the new BLR version:
- enlarge some values that are currently held in a single bit
- allow for reuse of holes in the BLR namespace without risk of
misinterpreting a deprecated verb
- allow for BLR streams bigger than 64K thus supporting procedure BLR that
will be stored in multiple blob segments if necessary (AFAIK, gbak is
prepared to handle that).

Also, somewhat related to this, I propose that for 64-bit FB, the limit
MAX_REQUESTS_SIZE should be raised, too or estimated on the fly or put in
the config file.

C.
---
Claudio Valderrama C. - www.cvalde.net
Consultant, SW developer.


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to