GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    calicoding (calicoding@mastodon.social)'s status on Saturday, 07-Dec-2024 09:12:01 JST calicoding calicoding

    Ok I wasn’t sure at first, but it seems like the performance issue I’m facing is partially due to ref counting. It’s not free!

    I’m working in a system I didn’t design, that relies heavily on reference types and inheritance. Given the chance, I probably would have designed it differently, leaning more on value types.

    In conversation about 6 months ago from mastodon.social permalink
    • Embed this notice
      Helge Heß (helge@mastodon.social)'s status on Saturday, 07-Dec-2024 09:11:52 JST Helge Heß Helge Heß
      in reply to
      • Joe Groff
      • Matt Massicotte

      @joe @mattiem @calicoding Even if there is some atomic instruction doing the thing, the cores would still have to synchronize ie flush their pipelines, no? I don’t know much about such low levels and some info why it isn’t expensive would be welcome 🙃
      Or how expensive compared to a simple rc++ increment.
      My assumption is that RC is massively more expensive, is that wrong?

      In conversation about 6 months ago permalink
      Paul Cantrell repeated this.
    • Embed this notice
      Joe Groff (joe@f.duriansoftware.com)'s status on Saturday, 07-Dec-2024 09:11:52 JST Joe Groff Joe Groff
      in reply to
      • Helge Heß
      • Matt Massicotte

      @helge @mattiem @calicoding the particular instructions used for refcounting get speculatively executed as if they were nonatomic, so in the case where there's no contention, there's very little overhead (because the atomic codegen still needs more instructions than a nonatomic update, etc.) if it turns out later the memory location was contended then you throw all that work away and do it properly

      In conversation about 6 months ago permalink
    • Embed this notice
      Helge Heß (helge@mastodon.social)'s status on Saturday, 07-Dec-2024 09:11:57 JST Helge Heß Helge Heß
      in reply to
      • Matt Massicotte

      @mattiem @calicoding Ref counting actually is expensive because it is thread safe, it’s the global interpreter lock of Swift.
      (and it doesn’t just affect user types, all the cow types use it)

      In conversation about 6 months ago permalink
    • Embed this notice
      Joe Groff (joe@f.duriansoftware.com)'s status on Saturday, 07-Dec-2024 09:11:57 JST Joe Groff Joe Groff
      in reply to
      • Helge Heß
      • Matt Massicotte

      @helge @mattiem @calicoding on Apple Silicon™️, the expensiveness is at least only if you have actual contention accessing the refcount

      In conversation about 6 months ago permalink
    • Embed this notice
      Matt Massicotte (mattiem@mastodon.social)'s status on Saturday, 07-Dec-2024 09:11:58 JST Matt Massicotte Matt Massicotte
      in reply to

      @calicoding I saw your first post and was like “hmmmmm”, but this makes more sense

      In conversation about 6 months ago permalink
    • Embed this notice
      calicoding (calicoding@mastodon.social)'s status on Saturday, 07-Dec-2024 09:12:00 JST calicoding calicoding
      in reply to

      LOL so yes ref counting was a bottle neck, but only because I’m an idiot and accidentally called my heavy quadratic calculation hundreds of times more than I needed to 🤦♂️

      I wish this was easier to see in the profiler. But also: check your assumptions!

      In conversation about 6 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.