[📄 Docs] Create a `datasets` performance guide.
{'login': 'dynamicwebpaige', 'id': 3712347, 'node_id': 'MDQ6VXNlcjM3MTIzNDc=', 'avatar_url': 'https://avatars.githubusercontent.com/u/3712347?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/dynamicwebpaige', 'html_url': 'https://github.com/dynamicwebpaige', 'followers_url': 'https://api.github.com/users/dynamicwebpaige/followers', 'following_url': 'https://api.github.com/users/dynamicwebpaige/following{/other_user}', 'gists_url': 'https://api.github.com/users/dynamicwebpaige/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/dynamicwebpaige/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/dynamicwebpaige/subscriptions', 'organizations_url': 'https://api.github.com/users/dynamicwebpaige/orgs', 'repos_url': 'https://api.github.com/users/dynamicwebpaige/repos', 'events_url': 'https://api.github.com/users/dynamicwebpaige/events{/privacy}', 'received_events_url': 'https://api.github.com/users/dynamicwebpaige/received_events', 'type': 'User', 'site_admin': False}
[{'id': 1935892871, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODcx', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/enhancement', 'name': 'enhancement', 'color': 'a2eeef', 'default': True, 'description': 'New feature or request'}]
[]
Hi ! Yes this is definitely something we'll explore, since optimizing processing pipelines can be challenging and because performance is key here: we want anyone to be able to play with large-scale datasets more easily.

I think we'll start by documenting the performance of the dataset transforms we provide, and then we can have some tools to help debugging/optimizing them
## Brief Overview
Downloading, saving, and preprocessing large datasets from the `datasets` library can often result in [performance bottlenecks](https://github.com/huggingface/datasets/issues/3735). These performance snags can be challenging to identify and to debug, especially for users who are less experienced with building deep learning experiments.

## Feature Request
Could we create a performance guide for using `datasets`, similar to:
* [Better performance with the `tf.data` API](https://github.com/huggingface/datasets/issues/3735)
* [Analyze `tf.data` performance with the TF Profiler](https://www.tensorflow.org/guide/data_performance_analysis)

This performance guide should detail practical options for improving performance with `datasets`, and enumerate any common best practices. It should also show how to use tools like the PyTorch Profiler or the TF Profiler to identify any performance bottlenecks (example below).

![image](https://user-images.githubusercontent.com/3712347/156859152-a3cb9565-3ec6-4d39-8e77-56d0a75a4954.png)

## Related Issues
* [wiki_dpr pre-processing performance #1670](https://github.com/huggingface/datasets/issues/1670)
* [Adjusting chunk size for streaming datasets #3499](https://github.com/huggingface/datasets/issues/3499)
* [how large datasets are handled under the hood #1004](https://github.com/huggingface/datasets/issues/1004)
* [using map on loaded Tokenizer 10x - 100x slower than default Tokenizer? #1830](https://github.com/huggingface/datasets/issues/1830)
* [Best way to batch a large dataset? #315](https://github.com/huggingface/datasets/issues/315)
* [Saving processed dataset running infinitely #1911](https://github.com/huggingface/datasets/issues/1911)
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3829/reactions', 'total_count': 1, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 1, 'rocket': 0, 'eyes': 0}