ERDDAP / erddap

ERDDAP is a scientific data server that gives users a simple, consistent way to download subsets of gridded and tabular scientific datasets in common file formats and make graphs and maps. ERDDAP is a Free and Open Source (Apache and Apache-like) Java Servlet from NOAA NMFS SWFSC Environmental Research Division (ERD).
Creative Commons Zero v1.0 Universal
84 stars 58 forks source link

Optimize maxStringLength #77

Closed ChrisPJohn closed 2 years ago

ChrisPJohn commented 2 years ago

Because StringHolders store the strings as char array, using that directly instead of converting to a string saves a lot of time (and heap allocations).

Prior to this change Table.testReadInvalidCRA() ran in 117,394 ms with 72,509 ms being spent in StringArray.maxStringLength

With this change total time is 38,999 ms with StringArray.maxStringLength at 41.2 ms. There were also speed ups outside of maxStringLength which I believe is due to reducing GC.