Giter Site home page Giter Site logo

Comments (15)

ajwfrost avatar ajwfrost commented on May 18, 2024 4

So we've found the reason for these string allocations.. basically the AOT compilation needs to look up the traits of the vector of whatever object type is being referenced here, and it does this by creating the fully qualified name of the type and then doing an internal string-based query in the domain.

We're going to see if there's a different way that we can access the traits here that will avoid the string allocations; as a fallback option though, these strings should be being cached/reused so that they are created at most once for each vector type!

from adobe-runtime-support.

ajwfrost avatar ajwfrost commented on May 18, 2024 2

Yes we can look into this one, I've added it to our internal tracker at AIR-256

from adobe-runtime-support.

jimmymjing avatar jimmymjing commented on May 18, 2024 1

I'm facing the same issue.

from adobe-runtime-support.

PrimaryFeather avatar PrimaryFeather commented on May 18, 2024 1

Thanks so much for looking into this, Andrew! It's great to finally know what's happening here โ€“ and caching that String seems like a sound solution to me.

from adobe-runtime-support.

ajwfrost avatar ajwfrost commented on May 18, 2024 1

@hardcoremore this is on our current list - we did start looking at it so should have an implementation in there soon..

from adobe-runtime-support.

hardcoremore avatar hardcoremore commented on May 18, 2024

@ajwfrost Andrew, this is also important one. Is there a hope for this to be fixed?

from adobe-runtime-support.

hardcoremore avatar hardcoremore commented on May 18, 2024

Awesome,

Thanks so much Andrew.

Regards,

Caslav

from adobe-runtime-support.

hardcoremore avatar hardcoremore commented on May 18, 2024

Also this is happening for Vectors of non primitive type as well. It does not have to be Dictionary.

from adobe-runtime-support.

hardcoremore avatar hardcoremore commented on May 18, 2024

Awesome work Andrew!

So that is how much Adobe was lazy, at a minimum they could at least just use one string for each type but they were too lazy to even do that. Anyway this will save a lot of GC collection calls. Thanks again!

from adobe-runtime-support.

hardcoremore avatar hardcoremore commented on May 18, 2024

Hi @ajwfrost,

Any news about this issue?

Regards,

Caslav

from adobe-runtime-support.

hardcoremore avatar hardcoremore commented on May 18, 2024

Awesome, thanks @ajwfrost.

from adobe-runtime-support.

jimmymjing avatar jimmymjing commented on May 18, 2024

@ajwfrost @hardcoremore
Hello, I'm still facing this String allocation issue on iOS. Is there any news? thanks so much!

from adobe-runtime-support.

hardcoremore avatar hardcoremore commented on May 18, 2024

@jimmymjing this was fixed I think. But I didn't test it. Do you see one string allocation per Vector/Dictionary or multiple?

from adobe-runtime-support.

jimmymjing avatar jimmymjing commented on May 18, 2024

@hardcoremore I just read through your post on Starling's forum and I also thought it was fixed. but I'm seeing a lot of string allocation with DispatchEventWith() function call in scout.
Here's the screenshot: https://ibb.co/DKzCdWR

from adobe-runtime-support.

ajwfrost avatar ajwfrost commented on May 18, 2024

Hi all - I just spotted this thread again, thought this had been closed...
So we did update the code so that the original issue is fixed: there will be a string allocation when the first vector type is generated but subsequent accesses should reuse the strings.

It sounds like there are other places where string allocations are happening though. Don't forget that anywhere you create a String object there will be an allocation, so events are quite big culprits for this. Internally the character memory that holds the string is handled fairly efficiently, so e.g. the character memory holding "enterFrame" will be set up once, but then each event that's created will create a new String object that refers to this.

I don't think that's the most efficient thing in the world - even the fact that every frame is sent a newly created enterFrame event seems a bit daft to me. So we can look a bit further into efficiency savings here: please let me know of any particular issues you're seeing where you think that string allocations should be unnecessary!

thanks

from adobe-runtime-support.

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.