GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — operations on ByteBuffer/IntBuffer · Issue #46 · fast-pack/JavaFastPFOR

operations on ByteBuffer/IntBuffer #46

New issue
Copy link
New issue
Copy link
Open
Open
operations on ByteBuffer/IntBuffer#46
Copy link

Description

@phraktle
phraktle
opened on Nov 30, 2020
Issue body actions

Hi,

I'm interested in decoding integers from an off-heap direct buffer, but I currently see no way of doing this without copying them to the heap. Is there a suggested method of doing this? Is there a fundamental (eg. performance) reason why this is not implemented or is it just to avoid the complexity?

Thanks,
Viktor

Activity

  1. lemire commented on Nov 30, 2020

    @lemire
    lemire
    on Nov 30, 2020
    Member
    More actions

     Is there a fundamental (eg. performance) reason why this is not implemented or is it just to avoid the complexity?

    Does the following help?

    Java Buffer types versus native arrays: which is faster?
    https://lemire.me/blog/2020/11/30/java-buffer-types-versus-native-arrays-which-is-faster/

  2. lemire commented on Dec 1, 2020

    @lemire
    lemire
    on Dec 1, 2020
    Member
    More actions

    If someone would like to propose pull requests leveraging Buffer types, I would be eager to review it. However, one has to be mindful of the performance considerations... and it is not trivial...

    The complexity is not much of an issue. One could almost entirely automate the conversion process with a script.

    However, it would be easy for a user to get bad performance, through no fault of their own, by misusing the Buffer types. So one would need to add good documentation/guidance.

  3. huang-jesse commented on Nov 1, 2023

    @huang-jesse
    huang-jesse
    on Nov 1, 2023
    More actions

    Good insight. I recently implemented a TSDB using DirectByteBuffer to hold int data, because I didn't want a transfer station (and wanted to save memory), so I did not use native arrays .

    However, your opinion makes sense. native arrays may provide better performance compared to ByteBuffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.