Walk command

Discussion in 'Tally Integration' started by Sridharan S, Nov 27, 2024.

Tags:
  1. Sridharan S

    Sridharan S New Member


    I process Xml response from Tally. Using "walk collection" I can get only relevant data. So far good. Profiling I found it is not significantly faster. Getting raw verbose response and processing as tree proved faster. What is your experience? or Is there difference difference between implementation of ftdl scripts and xHttp?
     


  2. Sridharan S

    Sridharan S New Member


    In some collection definitions adding these two lines
    <Add>SVFromDate</Add>
    <Add>SVToDate</Add>
    seems to speedup response many times. Why? Any guess...
     
    Last edited: Dec 16, 2024


  3. Sridharan S

    Sridharan S New Member


    Xml using Walk
    Code:
    <ENVELOPE>
    <HEADER>
    <VERSION>1</VERSION>
    <TALLYREQUEST>EXPORT</TALLYREQUEST>
    <TYPE>COLLECTION</TYPE>
    <ID>VTypeVch</ID>
    </HEADER>
    <BODY>
    <DESC>
    <TDL>
    <TDLMESSAGE>
    <COLLECTION NAME="VTypeVch" ISINITIALIZE="Yes">
    <TYPE>Voucher</TYPE>
    </COLLECTION>
    <COLLECTION NAME="DBVoucher src" ISINITIALIZE="Yes">
    <TYPE>Voucher</TYPE>
    <FETCH>LedgerEntries</FETCH>
    </COLLECTION>
    <COLLECTION NAME="VTypeVch" ISINITIALIZE="Yes">
    <SOURCECOLLECTION>DBVoucher src</SOURCECOLLECTION>
    <WALK>LedgerEntries</WALK>
    <FETCH>LedgerName</FETCH>
    <FETCH>Amount</FETCH>
    <COMPUTE>Guid:$GUID</COMPUTE>
    <COMPUTE>MId:$MasterId</COMPUTE>
    <COMPUTE>Date:$DATE</COMPUTE>
    <COMPUTE>VoucherTypeName:$VOUCHERTYPENAME</COMPUTE>
    <COMPUTE>Narration:NARRATION</COMPUTE>
    <COMPUTE>ledlIST:$$FullList:LedgerEntries:$LedgerName</COMPUTE>
    <FILTER>IsVType</FILTER>
    </COLLECTION>
    <SYSTEM TYPE="FORMULAE" NAME="IsVType">$VoucherTypeName = &quot;Purchase&quot;</SYSTEM>
    <Add>SVFromDate</Add>
    <Add>SVToDate</Add>
    </TDLMESSAGE>
    </TDL>
    <STATICVARIABLES>
    <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
    <SVFROMDATE Type="Date">20230402</SVFROMDATE>
    <SVTODATE Type="Date">202300402</SVTODATE>
    </STATICVARIABLES>
    </DESC>
    </BODY>
    </ENVELOPE>
    Xml using Data
    Code:
    <ENVELOPE>
    <HEADER>
    <VERSION>1</VERSION>
    <TALLYREQUEST>EXPORT</TALLYREQUEST>
    <TYPE>DATA</TYPE>
    <ID>Daybook</ID>
    </HEADER>
    <BODY>
    <DESC>
    <STATICVARIABLES>
    <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
    <SVCURRENTDATE>20230402</SVCURRENTDATE>
    <VoucherTypeName>$$VchTypePurchase</VoucherTypeName>
    </STATICVARIABLES>
    </DESC>
    </BODY>
    </ENVELOPE>
    Xml using Walk command gets concise response, but slow
    Xml importing as Data is faster (actually 14 times in my system). But it requires processing of the response though.
    Apart from these results (not related to them) Generally
    A Xml library to be fast should at least use Depth first Search.
    Once traversal only approach is better.
    Breadth First and BLS still better for Tally xml responses.
     
    Last edited: Dec 28, 2024


  4. Sridharan S

    Sridharan S New Member


    Using Walk for Merge Duplicate Ledger tested to be slower. So I reverted. The file is in SourceForge. Under 'Reports and Tools for Tally'
     


  5. Sridharan S

    Sridharan S New Member


    Before creating a voucher you may want to check ledger's existence in Tally. You can do that by
    1. using builtin function IsLedger
    or
    2. Getting Ledger list first and checking new ledger against it.
    First one increases network traffic and so may fail
     


  6. Sridharan S

    Sridharan S New Member


    Sax processing, particularly custom parser should be fast. Also simd enabled parsing with custom hooks. Xml generation by Tally would be still slow. For that I recommend multi thread parsing or at least getting each day' data on a separate thread. Breath first and Traverse once parsing reduced post generation processing time. With different type of data 50 MB of Xml was processed into 6 hundred KB of relevant data in less than 3 seconds. I shall publish Tally test data when simd enabled parser is ready.
     


Share This Page