Dataset is slower after calling `to_iterable_dataset`
CONTRIBUTOR
@lhoestq 
2023-08-16T04:39:13Z
https://github.com/huggingface/datasets/issues/6133#issuecomment-1679948986
https://api.github.com/repos/huggingface/datasets/issues/6133
IC_kwDODunzps5kIfy6
https://api.github.com/repos/huggingface/datasets/issues/comments/1679948986/reactions
2023-08-16T04:39:13Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1679948986
https://avatars.githubusercontent.com/u/11533479?v=4
https://api.github.com/users/npuichigo/events{/privacy}
https://api.github.com/users/npuichigo/followers
https://api.github.com/users/npuichigo/following{/other_user}
https://api.github.com/users/npuichigo/gists{/gist_id}
https://github.com/npuichigo
npuichigo
MDQ6VXNlcjExNTMzNDc5
https://api.github.com/users/npuichigo/orgs
https://api.github.com/users/npuichigo/received_events
https://api.github.com/users/npuichigo/repos
https://api.github.com/users/npuichigo/starred{/owner}{/repo}
https://api.github.com/users/npuichigo/subscriptions
User
https://api.github.com/users/npuichigo
public
MEMBER
It's roughly the same code between the two so we can expected roughly the same speed, could you share a benchmark ?
2023-08-16T09:18:54Z
https://github.com/huggingface/datasets/issues/6133#issuecomment-1680256471
https://api.github.com/repos/huggingface/datasets/issues/6133
IC_kwDODunzps5kJq3X
https://api.github.com/repos/huggingface/datasets/issues/comments/1680256471/reactions
2023-08-16T09:18:54Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1680256471
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
### Describe the bug

Can anyone explain why looping over a dataset becomes slower after calling `to_iterable_dataset` to convert to `IterableDataset`

### Steps to reproduce the bug

Any dataset after converting to `IterableDataset`

### Expected behavior

Maybe it should be faster on big dataset? I only test on small dataset

### Environment info

- `datasets` version: 2.14.4
- Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.17
- Python version: 3.8.15
- Huggingface_hub version: 0.16.4
- PyArrow version: 12.0.1
- Pandas version: 1.5.3