github.com/snowflakedb/gosnowflake@v1.9.0/benchmark/jsonresultset/README.rst (about)

     1  ********************************************************************************
     2  Benchmark Large Result Set
     3  ********************************************************************************
     4  
     5  This folder includes a benchmark test case for "JSON Result Set", which refers
     6  to a query result of more than 100 MB of JSON objects. This differs from the "Large
     7  Result Set" case, since it benchmarks large strings with many escaped characters.
     8  
     9  Profiling
    10  =========
    11  
    12  Using Go's profilers, you may see CPU and memory usage on each function/method. 
    13  This command instruments CPU and memory usage and save them into files.
    14  
    15  .. code-block:: bash
    16  
    17      SNOWFLAKE_TEST_ACCOUNT=<your_account> \
    18      SNOWFLAKE_TEST_USER=<your_user> \
    19      SNOWFLAKE_TEST_PASSWORD=<your_password> \
    20      SNOWFLAKE_TEST_CUSTOME_JSON_DECODER_ENABLE=<true/false> \
    21      SNOWFLAKE_TEST_MAX_CHUNK_DOWNLOAD_WORKERS=<number_of_workers> \
    22      make profile
    23  
    24  Check CPU usage on the web browser:
    25  
    26  .. code-block:: bash
    27  
    28      go tool pprof jsonresultset.test cpu.out
    29      (pprof) web
    30  
    31  Check memory usage on the web browser:
    32  
    33  .. code-block:: bash
    34  
    35      go tool pprof -alloc_space jsonresultset.test mem.out
    36      (pprof) web
    37  
    38  Note adjust SNOWFLAKE_TEST_CUSTOME_JSON_DECODER_ENABLE and SNOWFLAKE_TEST_MAX_CHUNK_DOWNLOAD_WORKERS to
    39  
    40  Tracing
    41  =======
    42  
    43  Using Go's trace tool, you may see all of the goroutine's activity with timeline.
    44  
    45  .. code-block:: bash
    46  
    47      SNOWFLAKE_TEST_ACCOUNT=<your_account> \
    48      SNOWFLAKE_TEST_USER=<your_user> \
    49      SNOWFLAKE_TEST_PASSWORD=<your_password> \
    50      SNOWFLAKE_TEST_CUSTOME_JSON_DECODER_ENABLE=<true/false> \
    51      SNOWFLAKE_TEST_MAX_CHUNK_DOWNLOAD_WORKERS=<number_of_workers> \
    52      make trace
    53  
    54  Check goroutine's activities on web browser.
    55  
    56  .. code-block:: bash
    57  
    58      go tool trace jsonresultset.test trace.out
    59  
    60