dcirne / flatten Goto Github PK
View Code? Open in Web Editor NEWFast access to values in a data structure is paramount for high throughput systems. Here we explore how parsing and traversing a data structure may be a costly operation for systems processing large volumes of data. We examine two implementations. First, in pure Python. Second, a hybrid Python and C++ implementation interfaced using SWIG, where we can increase the performance by a factor of 4 or more; your mileage may vary. In either case we will see significant gains in performance by access values in a flat data structure, compared to traversing a nested one.
License: Apache License 2.0