https://linen.dev logo
Join Discord
Powered by
# ceramic
  • m

    miniature-lawyer-98519

    02/13/2023, 1:02 PM
    all Constructors
  • m

    miniature-lawyer-98519

    02/13/2023, 1:03 PM
    One thing i noted in low level calls in Flutter towards the C# backend... is the use of native types.
  • m

    miniature-lawyer-98519

    02/13/2023, 1:03 PM
    most "draw" calls, becomes a list of floats
  • m

    miniature-lawyer-98519

    02/13/2023, 1:04 PM
    so vectors, matrix, etc Arrays of doubles/floats [0.0,0.0]
  • m

    miniature-lawyer-98519

    02/13/2023, 1:04 PM
    accessors on haxe are overkilling for that?
  • m

    miniature-lawyer-98519

    02/13/2023, 1:05 PM
    Idk if some "optimized" Array/List/Collection is available to define the memory allocation beforehand as it will work by reference.
  • m

    miniature-lawyer-98519

    02/13/2023, 1:05 PM
    nvm thought... i'm a rookie on that memory management topic...
  • b

    billowy-waiter-28954

    02/13/2023, 1:05 PM
    It's also better to enforce more locality of memory and reduce fragmentation: all primitive typed fields of a same class instance are located in the same area in memory, better for CPU caching etc...
  • b

    billowy-waiter-28954

    02/13/2023, 1:06 PM
    Using Point objects completely destroys that in Haxe and creates a lot of fragmentation
  • m

    miniature-lawyer-98519

    02/13/2023, 1:06 PM
    gotcha
  • b

    billowy-waiter-28954

    02/13/2023, 1:06 PM
    But if those Point types are not pointers and actual "structs", then that's fine
  • m

    miniature-lawyer-98519

    02/13/2023, 1:06 PM
    nop
  • m

    miniature-lawyer-98519

    02/13/2023, 1:07 PM
    i think there're not "structs"... but anyway, i'm getting ahead of myself.
  • b

    billowy-waiter-28954

    02/13/2023, 1:09 PM
    Yea, then you'd better keep the plain fields instead of Point objects performance wise. But it's not like it's going to be crazy slow either if you do use Point objects anyway
  • m

    miniature-lawyer-98519

    02/13/2023, 1:12 PM
    true
  • m

    miniature-lawyer-98519

    02/13/2023, 1:13 PM
    but imagine that Flutter relies on "immutability"
  • m

    miniature-lawyer-98519

    02/13/2023, 1:13 PM
    most objects are "const"
  • m

    miniature-lawyer-98519

    02/13/2023, 1:13 PM
    and relies on memory pointer hashCode equality.
  • m

    miniature-lawyer-98519

    02/13/2023, 1:14 PM
    like a point in Flutter is
    const Offset(dx, dy)
  • m

    miniature-lawyer-98519

    02/13/2023, 1:14 PM
    you can not mutate it, everything is 'final'
  • m

    miniature-lawyer-98519

    02/13/2023, 1:14 PM
    same for other geom primitives, like
    Rect
  • m

    miniature-lawyer-98519

    02/13/2023, 1:14 PM
    so u keep creating new instances...
  • m

    miniature-lawyer-98519

    02/13/2023, 1:15 PM
    That tells me Dart has a super optimized GC VM for that sort of mem allocation.
  • m

    miniature-lawyer-98519

    02/13/2023, 1:15 PM
    idk
  • b

    billowy-waiter-28954

    02/13/2023, 1:15 PM
    Yeah I don't know how it works internally
  • m

    miniature-lawyer-98519

    02/13/2023, 1:15 PM
    it always felt so counter-intuitive.
  • m

    miniature-lawyer-98519

    02/13/2023, 1:16 PM
    me neither
  • b

    billowy-waiter-28954

    02/13/2023, 1:20 PM
    Anyway, the arcade repo is kind of cleaned up from anything directly related to Phaser. Because phaser's v2 arcade physics were using phaser types like sprite or tilemap. Removed all this to have something more agnostic
  • b

    billowy-waiter-28954

    02/13/2023, 1:20 PM
    Just "bodies"
  • m

    miniature-lawyer-98519

    02/13/2023, 1:28 PM
    lovely
1...666768...124Latest