Homebrew / ruby-macho

🔩 A pure-Ruby library for parsing Mach-O files.
https://rubygems.org/gems/ruby-macho
MIT License
242 stars 33 forks source link

MachOView needs to support lazy loading for content #433

Open rickmark opened 2 years ago

rickmark commented 2 years ago

As we start to parse contents of various regions, it would be helpful to not hold in memory @raw_data but materialize as needed in MachOView.

This can be accomplished by using the new file reference and seek / read to pull in the data lazy

woodruffw commented 2 years ago

Yeah, that's the idea behind #23. I opened that years ago and never got around to it, partially because the performance gains weren't substantial for Homebrew's use case. But I would happily accept a changeset for that now.

rickmark commented 2 years ago

Working towards it, curious how useful mmap files would be for these larger concerns but that is a native dependency for the OS so possible only as an optimization?

Get Outlook for iOShttps://aka.ms/o0ukef


From: William Woodruff @.> Sent: Thursday, January 13, 2022 5:52:05 PM To: Homebrew/ruby-macho @.> Cc: Rick Mark @.>; Author @.> Subject: Re: [Homebrew/ruby-macho] MachOView needs to support lazy loading for content (Issue #433)

Yeah, that's the idea behind #23https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FHomebrew%2Fruby-macho%2Fissues%2F23&data=04%7C01%7C%7C515dc61018774b88aadf08d9d7007858%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637777219293843900%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=ElheJHCY0sPM3SZEIYxYkN4k5OR9WRrwl8zaRNjJVis%3D&reserved=0. I opened that years ago and never got around to it, partially because the performance gains weren't substantial for Homebrew's use case. But I would happily accept a changeset for that now.

— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FHomebrew%2Fruby-macho%2Fissues%2F433%23issuecomment-1012676684&data=04%7C01%7C%7C515dc61018774b88aadf08d9d7007858%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637777219294000135%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=f2l9QVCX4HIA64eyeKLngavI0LHadR7pJQfqnoEVH0A%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAA6TW3KQ7LPXJIMP3JTFMTUV56ULANCNFSM5L5MVQYA&data=04%7C01%7C%7C515dc61018774b88aadf08d9d7007858%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637777219294000135%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=QZpeQDYX4I1GFdhEitJa%2BzZeyCynC2ZLDETJoqYJMeQ%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.***>

woodruffw commented 2 years ago

Yeah, that's the trouble with mmap. We could consider the mmap gem but in general we've tried to keep ruby-macho at zero dependencies because it gets vendored into Homebrew.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.