Dataset scan time is much slower than using native arrow
{'login': 'jonny-cyberhaven', 'id': 121845112, 'node_id': 'U_kgDOB0M1eA', 'avatar_url': 'https://avatars.githubusercontent.com/u/121845112?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/jonny-cyberhaven', 'html_url': 'https://github.com/jonny-cyberhaven', 'followers_url': 'https://api.github.com/users/jonny-cyberhaven/followers', 'following_url': 'https://api.github.com/users/jonny-cyberhaven/following{/other_user}', 'gists_url': 'https://api.github.com/users/jonny-cyberhaven/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/jonny-cyberhaven/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/jonny-cyberhaven/subscriptions', 'organizations_url': 'https://api.github.com/users/jonny-cyberhaven/orgs', 'repos_url': 'https://api.github.com/users/jonny-cyberhaven/repos', 'events_url': 'https://api.github.com/users/jonny-cyberhaven/events{/privacy}', 'received_events_url': 'https://api.github.com/users/jonny-cyberhaven/received_events', 'type': 'User', 'site_admin': False}
[]
[]
Hi ! In your code you only iterate on the Arrow buffers - you don't actually load the data as python objects. For a fair comparison, you can modify your code using:
```diff
-     for _ in range(0, len(table), bsz):
-         _ = {k:table[k][_ : _ + bsz] for k in cols}
+     for _ in range(0, len(table), bsz):
+         _ = {k:table[k][_ : _ + bsz].to_pylist() for k in cols}
```

I re-ran your code and got a speed ratio of 1.00x and 1.02x Ah I see, datasets is implicitly making this conversion. Thanks for pointing that out!

If it's not too much, I would also suggest updating some of your docs with the same `.to_pylist()` conversion in the code snippet that follows [here](https://huggingface.co/course/chapter5/4?fw=pt#:~:text=let%E2%80%99s%20run%20a%20little%20speed%20test%20by%20iterating%20over%20all%20the%20elements%20in%20the%20PubMed%20Abstracts%20dataset%3A). This code snippet shows `datasets` code that reads the Arrow data as python objects already, there is no need to add to_pylist. Or were you thinking about something else ?
### Describe the bug

I'm basically running the same scanning experiment from the tutorials https://huggingface.co/course/chapter5/4?fw=pt except now I'm comparing to a native pyarrow version.

I'm finding that the native pyarrow approach is much faster (2 orders of magnitude). Is there something I'm missing that explains this phenomenon?

### Steps to reproduce the bug

https://colab.research.google.com/drive/11EtHDaGAf1DKCpvYnAPJUW-LFfAcDzHY?usp=sharing

### Expected behavior

I expect scan times to be on par with using pyarrow directly.

### Environment info

standard colab environment
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/5475/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}