Exemple #1
0
def main(use_locking=None):
    """
    :param use_locking: bool
    :return:
    """
    if use_locking is None:
        use_locking = get_locking_pref()

    config_logging(use_locking)

    random.seed(0)
    data = [random.random() for _ in range(200)]
    start = time.time()
    logging.getLogger().info(process_data_set(data))
    logging.getLogger().info(time.time() - start)
Exemple #2
0
def main(use_locking=None):
    if use_locking is None:
        use_locking = get_locking_pref()
    config_logging(use_locking)

    docs = list(range(num_docs_total))

    logging.getLogger().info("Processing %d documents using %d processes." %
                             (num_docs_total, NUM_PROCESSES))

    total_results = extract_document_data_multiprocess(docs)

    logging.getLogger().info("NUM_DOCS_TOTAL: %d, len(total_results): %d" %
                             (num_docs_total, len(total_results)))
    logging.getLogger().info(total_results)
Exemple #3
0
def main(use_locking=None):
    if use_locking is None:
        use_locking = get_locking_pref()

    config_logging(use_locking)

    docs = list(range(NUM_DOCS_TOTAL))

    # print("Processing %d documents using %d processes." %
    #       (NUM_DOCS_TOTAL, NUM_PROCESSES))
    logging.getLogger(__name__).info(
        "Processing %d documents using %d processes." %
        (NUM_DOCS_TOTAL, NUM_PROCESSES))

    # start_time = time.perf_counter()
    total_results = extract_document_data_multiprocess(docs)
    # elapsed_time = time.perf_counter() - start_time

    logging.getLogger(__name__).info(
        "NUM_DOCS_TOTAL: %d, len(total_results): %d" %
        (NUM_DOCS_TOTAL, len(total_results)))
    logging.getLogger(__name__).info(total_results)