Coder Social home page Coder Social logo

Comments (2)

segiddins avatar segiddins commented on August 28, 2024

Most everything is a framework search path, which headermaps won't work for -- we'd need a vfs overlay, and either way, this is how Xcode handles search paths for framework headers, and we don't want to deviate in behavior

from rules_ios.

jerrymarino avatar jerrymarino commented on August 28, 2024

Makes sense to me, I haven't tested using a VFS VS hmap recently but originally the hmap loaded a lot faster into memory and was faster for clang. This being aside, I noticed a few things when playing around with this locally:

A basic Xcode project with frameworks

Xcode puts built frameworks into single directory - tools would find the build frameworks at O(1) search cost if it gets the it the build directory in the search first - it seems to in my testing.

In practice, the tools like clang swift and ld would up finding a matching dep framework in the build directory and won't search further.

Specifically the command lines always will have the first search path

-F/Path/toDerivedData/*/Build/Products/Debug-iphonesimulator

Cocoapods default behavior with a framework

Cocoapods version I'm running locally seems to put frameworks in their own directory, so even if xcode were to have the path as above it won't find them. This would implicate the O(N) deps searching as above, unless of course it is using a top level VFS or other mechanism to mitigate the search in clang and swift.

-F/Path/toDerivedData/*/Build/Products/Debug-iphonesimulator/DepA
-F/Path/toDerivedData/*/Build/Products/Debug-iphonesimulator/DepB

Mitigation going forward

I'm interested to see flame graphs and --profiling output for any solution to this before and after 📈

Perhaps a VFS could be a path to get it to the state of O(1) framework locating: vs having to search all the transitive framework paths. I'm interested to see how this can impact the search algorithms in clang and swift, and also the cost of serializing in the json vfs. Where hmap is a binary hash table that's fast to map in.

Also, the module cache can help here. When not pulling from a populated module cache, it might still be expensive and may be worth worth profiling. The header search cost is probably paid down multiple times with per OS modules: #225

from rules_ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.