Execution time seems to be dependent on data when it shouldn't

Hi, consider the code shown below.  It generates a 2D array of random values between 0 and 1 and then builds an array with values of 0 or 1 depending on whether the random value was greater than a predefined threshold or not. 
I expected the running time to be independent of the value of the threshold, but there is significant difference (see results below). 
Any idea why this would be?  Also note the difference in running time when autoindexing and when using an array-greater-than.

I would say the way to determine whether it is the branch-prediction (i.e. sequence of comparison) or the 64/32 bit effect (actual data dependence independent of the order of comparisons) that is causing this behaviour is through the following experiment:
Create 2 large equal-sized arrays with random values:  the first with random values between 0 and 1, and the second with the first half filled with random values between 0 and 0.5 and the second half with random values between 0.5 and 1.  Then time how long it takes to perform a comparison on the whole array with a threshold of 0.5. 
So if the cause is branch prediction, the second array will threshold faster than the first as the branch prediction will be correct in all but 2 comparisons (at the start of the array and at the middle off the array).
However, if the cause is the 64/32 bit suggestion, both arrays will threshold in the same amount of time.
Well here are my results:
On my PC there is no significant running time difference whether it is single our double precision. 
There is a large difference though when I run the two same size arrays and compare them to 0.5 - the one with the first half containing random values smaller than 0.5 and the second half random values larger than 0.5 runs 25% faster than one with random values between 0 and 1.
Thus my verdict - it is branch prediction that is the cause of the data-dependent running times. 

Similar Messages

  • Reducing query execution time while handling large amt of data

    Can you please give any suggestions for the reducing the time required for quries to return results which are fired on tables containing huge amount of data (trillions of records) ??

    Realize that this is like getting a request to get someone a vehicle with no idea what it is to be used for.
    Can you at least give us the query, ideas of data from each table and what indexes you have available. More would be better, but those would be things you'd have access to even if you are not experienced enough with Oracle to get us explain plans and such (yes, to really do this right you'd need that or need to work with someone who can get you that).

  • Time Machine backing up lots of data when computer is idle for hours

    Is there anyway to see what exactly Time Machine is backing up? No new apps installed, only iTunes (sometimes), Safari and Mail running, no new mail and/or nothing with attachments. Not syncing iPhones or buying music. Whether I'm surfing around or or just have my MBP on and doing something else when Time Machine runs every hour it'll be backing up anywhere from 1-2Mb (acceptable) to 600Mb of data and everywhere in between. What files are changing that much/often? This has been happening for several weeks, not sure exactly when it started because I usually just let Time Machine do its thing and don't check every time to see how much its backing up.
    MBP, 10.5.6, 500Gb Time Capsule
    Thank you for any help

    try TimeTracker
    http://www.charlessoft.com/TimeTracker.zip
    also, are you using any virtualization software, Entourage or any other programs that use large database files? those database files are treated like single files by TM and any time you make any change to any of them TM backs them up afresh.

  • Time Machine backs up 50GB of data when all but 5GB is excluded

    I have everything but my home folder excluded from Time Machine's backups. I have at most 5GB of stuff in my home folder. Yet when Time Machine starts it's backup it says that it's backing up xxxMB of 53.33GB. I don't even have that much stuff on my harddrive grand total. What gives?

    Nevermind. It stopped at 5GB. My bad.

  • Feature request - execution time in SQL Developer

    I am looking for some feature to detail the execution time of packages/stored procedures/functions. When a package completes execution, lets say, it took longer time than usual ; I would like to know which stored procedures or SQLs within took the longest time. I could trace the session. It will be very helpful if there is a feature on the tool.
    Thanks

    Look into PL/SQL Profiling. If you are on RDBMS version 11, then profiling command appears in context menu and toolbar.

  • Time-dependent master data in the cube and query

    Hello,
    I have a time-dep. masterdata infoobject with two time-dep attributes (one of them is KF). If i add this infoobject into the cube, what time period SID will be considered during the load? I assume it only matters during load, if i add the KF to the query it gets its value based on the SID in the cube.. right?
    Thanks,
    vamsi.

    If its Time Dependent Master Data object when you run your Master Data if that time any changes to the Master Data that value will be overwrite to the old value you will get the new value. When you run the Query execution the Infocube Master Data infoobject will having the SID that time it will to there it will be displayed at that moved what is the value you have in the Master Data table.
    This is what my experience.
    Thanks,
    Rajendra.A

  • Do the execution time of the insert command depend upon the no the indexes

    hi,
    Do the execution time of the insert,update and delete command depend upon the no the indexes created for a table......
    Edited by: [email protected] on Mar 4, 2009 3:02 AM

    sure,..
    An index is a structure which contains entries pointing to the actual data in the table.
    When you insert a record into a table, the data which should also be indexed is inserted in the index structure. This index data needs to be in a specific place, not just anywhere (as opposed to e.g. a heap table).
    So this might lead to an update and insert in the index structure.
    This is just to give you an idea. More on the subject in Tom Kyte's Expert Oracle Database Architecture and of course Oracle's documentation.

  • Reporting on Time Dependent Master Date Info Provider

    Dear All.
    We have a info object Employee which is time dependent master data containing all the information with time dependency, when i create the query over this info object it give me the option to select the key date and it show the accurate information which is lying according to the key date.
    my requirement is to show all the records in the report which are there in master data but i am not able to show more then one record cause of the key date, can you please let me know how can i show all the records for any given employee id in the query.

    Hello Zeeshan,
    By standard if you create query directly on time dependent info object, it would display the active records as of the report execution (if no key date has been provided). In any case you can only see one record per the info object key, not the history.
    In order to fulfill this requirement, you may need to create infoset on this infoobject and select "date from" and "date to" as part of infoset fields.
    Then create bex query on the infoset and drag the "date from" and "date to" also into "rows" section of the query (apart from infoobject key, time dependent attributes). This will let you see the history of changes to time-dependent attributes of the infoobject.
    Cheers,
    Vasu

  • Loading time-dependent master data using update rules/transformations

    Hi
    I am trying to load time-dependent master data to an infoobject. It seems that I get an error message on duplicate records if I use a transformation or update rule. Does this only work with direct update ?

    In the DTP you have the option to ignore duplicate records....
    Just select that and then load data...

  • Data not uploading in Time dependent Master data Infoobject

    Hello All,
    I have a master data infoobject for HR entity and have to load data from PSA to that info object.
    The HR entity infoobject already have sone data like below:
    HR Entity
    Version
    Date from
    Date To
    x
    A
    01.07.2013
    31.12.9999
    x
    A
    19.04.2013
    30.06.2013
    x
    A
    01.09.2012
    18.04.2013
    x
    A
    01.01.2012
    31.08.2012
    x
    A
    01.01.1000
    31.12.2011
    Now the data in PSA is as follows:
    HR Entity
    Start Date
    End Date
    X
    01.01.2012
    18.12.2013
    Once I loaded this data to the infoobject, i can not see this value which is the latest value of this HR entity.
    Can somebody please explain how the data gets loaded in the time dependent master data infoobject and why this entry is not getting loaded in the info object.
    Regards
    RK

    Hi,
    did you activate master data after your load?
    You can check also version 'M' records and see if your record is there.
    The load went green?
    The problem is, that your entry overlaps all exisitng time intervals, which can't be deleted or merged as there may be dependent transactional data. You have first to delete the transactional data for this entity.
    Then you can delete the time-dependent data and reoload it from your PSA.
    BW will build then correct time intervals.
    The easiest is to change the time interval in PSA, see example below:
    At the moment the time interval is not accepted. But you can add time intervalls before 31.12.2011 and after 01.07.2013, Then system will create remaiing time intervals, e.g. your new record is:
    HR Entity
    Start Date
    End Date
    X
    01.08.2013
    18.12.2013
    Result will be:
    HR Entity
    Version
    Date from
    Date To
    x
    A
    19.12.2013
    31.12.9999
    x
    A
    01.08.2013
    18.12.2013
    x
    A
    01.07.2013
    31.07.2013
    Regards, Jürgen

  • What is time dependent master data?

    Can anybody explain me in detail with an example for time dependent master data?
    Thanks in advance.
    Sharat.

    hi,
    the master data value changes with respect to some time characteristics.
    say- Salesregion is a char that have sales rep as master data(attribute)
    saleregion  date from  date to              sales rep
    sr001        20/10/2007  20/12/2007          Ram
    sr002        21/12/2007  12/05/2008          Ram
    in the above example Ram is in two sales region in different dates.
    these type of attributes were time dependent.
    usually time period will be defined in the data range of 01/01/1000 to 31/12/9999.
    Ramesh

  • Modify code to pull the time dependent master data

    I fully under stand the suggestion below for the requirement to add the time dependent attribute comp code
    thanks fo rthe help but please tell me if there is a way i can modify the abap code and make the user enter the value for the date on which he want to pull th emaster data for company code or keydate to and from and pull the master data, so how will i proceede should i create the variable on 0doc_date and how to modify the code. please help . i have opened another question with same desc as above to assign points
    thanks
    soniya
    The literal within <..> is supposed to be replaced by the actual field name (as I didn't know the fields). In this case, I am changing your code for costcenter/company-code.
    data : wa like /bi0/qcostcenter.
    select single * from /bi0/qcostcenter into wa
    where costcenter = comm_structure-costcenter
    and objvers = 'A'
    and datefrom le comm_structure-<keydatefield>
    and dateto ge comm_structure-<keydatefield>.
    if sy-subrc = 0.
    result = wa-comp_code.
    endif.
    abort = 0.
    You can use this code for update rule of company_code. You have to replace '<keydatefield>' with a field name that contains the date on which the company is to be derived. If there is a date in your comm_structure (eg aedat) which you can use, you can specify that field in place of this literal (instead of comm_structure-<keydatefld> use comm_structure-aedat). If you have no such field, and you wish to use current date for getting the company code from time-dependent master data, you can use sy-datum (ie replace comm_strucutre-<keydatefld> with sy-datum).
    And it should work.
    The 'master data attribute' option is one of the options when you create update rule (one of the radio button options).

    That the code is doing anyway.
    If your txn data in the cube doesn't have a date, how does it know it is Feb data, or, it is March data?
    If it has a date or month field, you should modify and use this code to update the company based on that date instead of system date.
    Other than that minor variation, it is already doing what you look for.

  • Time dependent communication data.

    Hi,
    I would like to create a time dependent communication data in the standard Business Partner transaction ( Tcode - BP ).
    Scenario : A customer might call in to inform that for the coming 2 months he'll be away and wants all the communications be sent to a differnet address for this two months.
    Standard SAP documentation says that the the Business Address Service which currently handles the address managemnt does not support time dependent data.
    http://help.sap.com/saphelp_470/helpdata/en/12/ad797a5c5811d3b4ea006094192fe3/frameset.htm
    Any workarounds to this problem? Anyone who has ever faced such a requirement? Appreciate any ideas on this.
    Thanks, Debasish

    Hi Debasish,
    Workarounds, 2 spring to mind both with pros and cons:
    1. Maintain the customer in another client (an exact copy of the customer), and then use ALE to time the change. This would allow you to store up to 1 time dependent change in the future.  So, when you knew a change was coming you could change the customer in the other client, and then schedule the ALE job to process the idoc on the date that the change was due to take place.  The pro of this work around is there is no development to do, the cons are that it means keeping your customer data in another client, and that you can only store one change into the future and its not so user friendly.
    2. Build your own time dependent function for communication data.  Build a dynpro which called the standard address handling screens and then store the data in the standard address tables linked to your own custom tables for date/time of change etc.  Then schedule a batch job every day (or hour, or as required) to look through your scheduled changes and then call a bapi or idoc or function to update the customer with the stored addresses.  This should be great from the user friendliness point of view and will allow any number of future changes of address for each customer, but will require some development effort (although not a huge amount as you will be using standard functions a lot).
    Hope that helps.
    Brad

  • Time Dependency Master Data Load

    Hi:
    This is my first time to work on time dependency master data. I need help!
    I first deleted master data and cleaned up the PSA for material sales.
    Then I have turned on the feature of time dependent on the info object for material sales. Save it and activated the object.
    Then i have problems by loading the master sales attribute data in PSA. The error is: on every record of material, it has "invalid 'to' date '00/00/0000'" and "invalid 'from' data '00/00/0000'".
    Is every process i did wrong? What is the process to work on time dependent master data? and loading the data?
    Thank you!!

    Hi,
    After turning on the time dependence...you get an extra field in the key of the master data table Q table date to and a new field date from as a new field.
    These two fields needs to be mapped to date to and date from R/3 source as well.
    If there is no source field for these two then you need to make sure to get the values for these fields.
    Just check if you are getting any field like that from R/3...right now i think you have left the mappings for these fields as blank.
    Thanks
    Ajeet

  • Data Pump execution time

    I am exporting 2 tables from my database as a prelimary test before doing a full export ( as part of a server migration to an new server )
    I have some concerns about the time the export took ( and therefore the time the corresponding import will take - which typically is considerably longer than the export )
    Estimate in progress using BLOCKS method...
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 19.87 GB
    Processing object type TABLE_EXPORT/TABLE/TABLE
    Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
    Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    . . exported "SAPPHIRE"."A_SDIDATAITEM" 15.45 GB 88263813 rows
    . . exported "SAPPHIRE"."A_SDIDATA" 1.775 GB 14011593 rows
    Master table "SYSTEM"."EXPORT_TABLES_LIMSLIVE" successfully loaded/unloaded
    Dump file set for SYSTEM.EXPORT_TABLES_LIMSLIVE is:
    E:\ORACLE\PRODUCT\10.2.0\ADMIN\LIMSLIVE\DPDUMP\EXP_TABLES_LIMSLIVE.DMP
    Job "SYSTEM"."EXPORT_TABLES_LIMSLIVE" successfully completed at 15:43:38
    These 2 tables alone took nearly an hour to export. The bulk of the time seemed to be on the line
    Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Q1. Is that really the line that was taking time or was the export really working on the the export of the table on the following line ?
    Q2. Will such table stats be brought in on an import ? i.e. are table stats part of the dictionary therefore part of the SYS/SYSTEM schemas and will not be brought in on the import to my newly created target database ?
    Q3. Does anyone know of any performance improvements that can be made to this export / import ? I am exporting from the 10.2.0.1 source Data Pump and will be importing on a new target 11gR2 Data Pump. From experiement with the command line I have found that 10.2.0.1 does not support PARALLEL so I am not able to use that on the export side ( I should be able to use it on the 11gR2 import side )
    thanks,
    Jim

    Jim,
    Q1. what difference does it make knowing the difference between how long the Meta Data and the actual data takes on >export ?
    Is this because you could decide to exclude some objects and manually create them before import.You asked what was taking so long. This was just a test to see if it was metadata or data. It may help us try to figure out if there is a problem or not, but knowing what is slow, would help narrow things down.
    With the old exp/imp utility I sometimes manually created the tablespaces and indexes in this manner, however for Data >Pump the Meta Data contains a lot more than just tablespaces and indexes - I couldn't imagine manually creating all the >tables and grants for example. I guess you can be selective about what objects you include / exclude in the export or import >( via the INCLUDE & EXCLUDE settings ) ?No, I'm not suggesting that you change your process, just trying to figure out what is slow. Also, old exp/imp and Data Pump treat metadata and data the same way. Just to maybe clear things up - when you say content=metadata_only, it exports everything except for data. It will export tablespaces, grants, users, table, statistics, etc. Everything but the data. When you say content=data_only, it only exports the data. You can use this method to export and import everything, but it's not the best solution for most. If you create all of your metadata and then load the data, any indexes on the tables need to be maintained while the data is being loaded and this will slow down the data only job.
    Q2. If I do a DATA ONLY export I presume that means I need to manually pre-create every object I want imported into my >target database. Does this mean every tablespace, table, index, grant etc ( not an attractive option ) ?Again - I was not suggesting this method, just trying to figure out what was slow. If I were to do it this way, I would run the impdp on the metadata only dumpfile, then run the import on the data only dump file.
    Q3. If I use EXCLUDE=statistics does that mean I can simply regenerate the stats on the target database after the import >completes ( how would I do that ? )Yes, you can do that. There are different statistics gathering levels. You can collect them per table, per index, per schema, and I think per database. You want to look at the documentation for dbms_stats.gather...
    Dean

Maybe you are looking for

  • I have a video ipod with a problem

    i just got my ipod and i had uploaded a lot of songs and two music videos with songs. Well now the songs with the music videos and the two music videos are gone. I bought them from itunes but i cant find any of the FAQs for that. Everything else is f

  • Add "cost center" query to a start condition?

    Hi there, we got a new requirement for one of our plants. We're on SRM 5.0 classic scenario. Is it possible to add a "cost center" query to a specific start condition (SWB_PROCUREMENT) of a workflow? E.g. if a user uses cost center 4711 for a shoppin

  • Code generation tools

    Hello Xperts, Is there any code generation tool for hibernate & spring for java standalone application? Thanks!

  • MOV files onto final cut pro?

    Hey, I shot some footage on my Canon Rebel T2i and have put them all on my computer as MOV files. Now when I drag and drop them into final cut, they are choppy and every 5 seconds or so a pop up comes up telling me frames have been dropped. Is there

  • I have accidently made an in app purchase how do i get refund

    i have accidently made an in app purchase how do i get refund