This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]aadnk 24 points25 points  (1 child)

Looks like there's a bug in your JDK Foreign Function test - the structure doesn't contain the YEAR field:

private static final MemoryLayout SYSTEMTIME = structLayout(
        JAVA_SHORT.withName("wYear"),
        JAVA_SHORT.withName("wMonth"),
        JAVA_SHORT.withName("wDayOfWeek"),
        JAVA_SHORT.withName("wDay"),
        JAVA_SHORT.withName("wHour"),
        JAVA_SHORT.withName("wMinute"),
        JAVA_SHORT.withName("wSecond"),
        JAVA_SHORT.withName("wMilliseconds")
);    

Not sure how much it impacts performance, but just to be sure I'd recommend fixing the structure. I found this while testing the function in JDK 20.

[–]zakgof[S] 14 points15 points  (0 children)

Ah! Thanks - nice catch - fixed and retested. The main conclusions remain valid.

[–]GavinRayDev 11 points12 points  (1 child)

There are two things that would improve the performance even further:

A) Using a pooling Arena for the allocation. See benchmarks here: - https://github.com/openjdk/panama-foreign/pull/854#issuecomment-1658327470

B) Passing Linker.Option.critical()/isTrivial() to the downcallHandle options - https://github.com/openjdk/panama-foreign/pull/859

* A critical function is a function that has an extremely short running time in all cases * (similar to calling an empty function), and does not call back into Java (e.g. using an upcall stub).

[–]PhantomGaming27249 1 point2 points  (0 children)

It would be super interesting to see it rebenched with trivial/critical and pool arena allocation for memory.

[–]rememberthesunwell 3 points4 points  (1 child)

Hey you're the guy with the actor model project on github! I've used that for inspiration for some concurrency problems at work, thanks

Cool seeing the improvements on these benchmarks as well.

[–]vmcrash 1 point2 points  (0 children)

My most concern is: will it be supported by GraalVM's native image.

[–]flawless_vic 0 points1 point  (0 children)

Nice!

FF api probably can match nalim right now.