Title: [Idea] Implement using Iterators instead of arrays · Issue #1 · functional-php/parallel · GitHub
Open Graph Title: [Idea] Implement using Iterators instead of arrays · Issue #1 · functional-php/parallel
X Title: [Idea] Implement using Iterators instead of arrays · Issue #1 · functional-php/parallel
Description: Hello, I think we can save some time and memory on large data sets by using iterators instead of arrays here: https://github.com/functional-php/parallel/blob/master/src/functions.php#L75 If we provide an iterator (from a DB statement for...
Open Graph Description: Hello, I think we can save some time and memory on large data sets by using iterators instead of arrays here: https://github.com/functional-php/parallel/blob/master/src/functions.php#L75 If we prov...
X Description: Hello, I think we can save some time and memory on large data sets by using iterators instead of arrays here: https://github.com/functional-php/parallel/blob/master/src/functions.php#L75 If we prov...
Opengraph URL: https://github.com/functional-php/parallel/issues/1
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Idea] Implement using Iterators instead of arrays","articleBody":"Hello,\r\n\r\nI think we can save some time and memory on large data sets by using iterators instead of arrays here:\r\nhttps://github.com/functional-php/parallel/blob/master/src/functions.php#L75\r\n\r\nIf we provide an iterator (from a DB statement for example), we have to traverse it once in the `iterator_to_array` statement, then `array_chunk` make use traverse the data set once more.\r\n\r\nUsing iterators will not be a problem with array, as we already have `\\ArrayIterator` class in SPL.\r\n\r\nMoreover, instead of traversing two arrays here: https://github.com/functional-php/parallel/blob/master/src/functions.php#L59 , we could only traverse it once and apply the two functions in the same time.\r\n\r\nBTW, a major part of the problem has already been solved in this (great) lib from nikic: https://github.com/nikic/iter/ (chunk, map and filter).\r\n\r\nIn the worst case, we could save 3 of 4 iterations. :-)\r\n\r\nWhat do you think of this idea ? :-)","author":{"url":"https://github.com/lovenunu","@type":"Person","name":"lovenunu"},"datePublished":"2016-11-17T11:16:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1/parallel/issues/1"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c7d7e7f6-ce9b-5917-677b-abd257d85fa4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFA0:C2770:47BD359:6268EF8:698CB881 |
| html-safe-nonce | 9085bc783f729da27e02389011af72a2179bd543be1a41c438e44fc86b327a07 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkEwOkMyNzcwOjQ3QkQzNTk6NjI2OEVGODo2OThDQjg4MSIsInZpc2l0b3JfaWQiOiIyMzgzNDYzNzM0NDI3MDM5ODczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a0238b45fec6a1ac7a8bb2dc46aaa609e6afe5fc5a21a8e46c4b6a8d26bc21e5 |
| hovercard-subject-tag | issue:190017176 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/functional-php/parallel/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/50d660e07dc7e72cfd4bfb604a09223e7082ceb0da063ed6e07c34717a4d50a9/functional-php/parallel/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/50d660e07dc7e72cfd4bfb604a09223e7082ceb0da063ed6e07c34717a4d50a9/functional-php/parallel/issues/1 |
| og:image:alt | Hello, I think we can save some time and memory on large data sets by using iterators instead of arrays here: https://github.com/functional-php/parallel/blob/master/src/functions.php#L75 If we prov... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lovenunu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 640eeb7b6ff4d8d106235d228c0c286e82592d4d2403227b5b2b4fc5832297a4 |
| turbo-cache-control | no-preview |
| go-import | github.com/functional-php/parallel git https://github.com/functional-php/parallel.git |
| octolytics-dimension-user_id | 22866697 |
| octolytics-dimension-user_login | functional-php |
| octolytics-dimension-repository_id | 73283402 |
| octolytics-dimension-repository_nwo | functional-php/parallel |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 73283402 |
| octolytics-dimension-repository_network_root_nwo | functional-php/parallel |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3d444f0a47beeeac94cddbb51c91ab408befe8d4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width