spreadsheet: speedup by removing intermediate copies 72/20972/11
authorClement DAVID <clement.david@esi-group.com>
Tue, 7 May 2019 09:57:12 +0000 (11:57 +0200)
committerCedric Delamarre <cdl@esi-group.com>
Thu, 16 Jan 2020 10:25:55 +0000 (11:25 +0100)
commitd785ee0ea7312504e754199ee25fbad2b5187839
tree43a6707810e5493c67dfb1b755476b9b0a02c248
parent1467bd18a2ac52047262517c7d5dce2a04649651
spreadsheet: speedup by removing intermediate copies

The passed wchar_t* array should only be copied once before working on
it. During the whole processing, there should be no copy on the common
case (but extra copies might be needed for corner cases). Performance
improvement is also highly related to wchar_t* Scilab string storage.

This commit patch csvTextScan and csvRead functionnalities; please note
that using mgetl and csvTextScan will still need 2 extra copies than
csvRead (1 to store mgetl results and 1 to have mutable buffers during
scanning).

Change-Id: I51f8c4b0e0437bfe4ac69439b739a60262da1cf1
31 files changed:
scilab/CHANGES.md
scilab/modules/spreadsheet/etc/spreadsheet.quit
scilab/modules/spreadsheet/sci_gateway/c/gw_csv_helpers.c
scilab/modules/spreadsheet/sci_gateway/c/gw_csv_helpers.h
scilab/modules/spreadsheet/sci_gateway/c/sci_csvDefault.c
scilab/modules/spreadsheet/sci_gateway/c/sci_csvRead.c
scilab/modules/spreadsheet/sci_gateway/c/sci_csvTextScan.c
scilab/modules/spreadsheet/sci_gateway/cpp/sci_xls_read.cpp
scilab/modules/spreadsheet/src/c/csvDefault.c
scilab/modules/spreadsheet/src/c/csvDefault.h
scilab/modules/spreadsheet/src/c/csvRead.c
scilab/modules/spreadsheet/src/c/csvRead.h
scilab/modules/spreadsheet/src/c/splitLine.c
scilab/modules/spreadsheet/src/c/splitLine.h
scilab/modules/spreadsheet/tests/benchmarks/csvRead.tst [new file with mode: 0644]
scilab/modules/spreadsheet/tests/nonreg_tests/bug_11999.dia.ref
scilab/modules/spreadsheet/tests/nonreg_tests/bug_11999.tst
scilab/modules/spreadsheet/tests/nonreg_tests/bug_13144.dia.ref
scilab/modules/spreadsheet/tests/nonreg_tests/bug_13144.tst
scilab/modules/spreadsheet/tests/nonreg_tests/bug_8349.dia.ref
scilab/modules/spreadsheet/tests/nonreg_tests/bug_8349.tst
scilab/modules/spreadsheet/tests/nonreg_tests/ticket_194.tst
scilab/modules/spreadsheet/tests/nonreg_tests/ticket_472.dia.ref [deleted file]
scilab/modules/spreadsheet/tests/nonreg_tests/ticket_472.tst
scilab/modules/spreadsheet/tests/unit_tests/csvRead_multi_line.csv [new file with mode: 0644]
scilab/modules/spreadsheet/tests/unit_tests/csvRead_multi_line.tst [new file with mode: 0644]
scilab/modules/string/includes/stringToComplex.h
scilab/modules/string/includes/stringToDouble.h
scilab/modules/string/src/c/stringToComplex.c
scilab/modules/string/src/c/stringToDouble.c
scilab/tools/profiling/valgrind.supp