question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ignore preprocessData option

See original GitHub issue

Does preprocessData() do anything if opts.unwind and opts.flatten are not defined? As far as I can tell, it creates a single item array for each row and then concats them back together. This is very inefficient in the browser when working with 100k+ rows.

I read that streams are more efficient, but I didn’t see any documentation about using this in the browser. Not sure if streams make sense in the browser since everything is in memory anyways.

I was able to “fix” the issue by just overriding the preprocessData function in a very hacky way. I was hoping you’d provide an option to skip preprocessing.

const parser = new Parser({ fields }) as any;
parser.preprocessData = (x:Array<any>) => x;
const csv = parser.parse(data);

Exporting ~90 fields and ~90k rows went from taking 45+ seconds (or freezing) to a more reasonable 9 seconds.

I’m using v4.3.3 in Chromium v70. Let me know if you need any other data.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
randdusingcommented, Mar 25, 2019

Works well, thanks again.

1reaction
juanjoDiazcommented, Feb 24, 2019

I’m working on a new API to use the streaming API in the browser easily. Just give me a couple days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data Preprocessing In Depth
Ignore the data row: This method is suggested for records where maximum amount of data is missing, rendering the record meaningless. This method ......
Read more >
Preprocess - Hugging Face
The main tool for preprocessing textual data is a tokenizer. A tokenizer splits text into tokens according to a set of rules. The ......
Read more >
How to make gcc skip preprocessing? - Stack Overflow
The -fpreprocessed option tells the gcc compiler the input file has already been preprocessed. That suppresses most of the preprocessing task. – ...
Read more >
Overall Options (Using the GNU Compiler Collection (GCC))
Input files that don't require preprocessing are ignored. -o file. Place the primary output in file file . This applies to whatever sort...
Read more >
Data preprocessing for ML: options and recommendations
This first part discusses the best practices for preprocessing data in an ML pipeline on Google Cloud. The document focuses on using TensorFlow ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found