GithubHelp home page GithubHelp logo

objectlayout / objectlayout Goto Github PK

View Code? Open in Web Editor NEW
406.0 53.0 28.0 1.38 MB

Java classes designed with optimizable object layout in mind

Home Page: http://objectlayout.github.com/ObjectLayout/

License: Other

Java 100.00%

objectlayout's Introduction

objectlayout's People

Contributors

giltene avatar gitter-badger avatar marschall avatar michaelmosmann avatar mikeb01 avatar mjpt777 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

objectlayout's Issues

Creating Intrinsic Objects from Legacy or 3rd party classes

Some times you do not have control over the coding of certain objects. Is it possible to give a mechanism which can intensify without having to add special constructs. Perhaps they can be injected through byte-code manipulation.

Perhaps thee ability to intensify object fields to n levels deep, or from certain packages, etc.

Provide APIs for construction with potentially inaccessible constructors

Pull request #4 raises a need to make some constructors (e.g. default constructor in the specific pull request case) useable when constructing objects using IntrinsicObjectModel. Similar needs exist in StructuredArray, and in some case they are supported by making the constructor accessible via reflection.

I am trying to avoid making constructors accessible this way for both default or non-default constructors, and will probably look to avoid doing the same in some of the StructuredArray cases that currently do (taking away the current accessible-forcing behavior). Making e.g. private or protected constructors accessible can lead to surprising and potentially insecure construction behavior.

Obviously, we have a problem here, in that a class that has access to a certain constructor that is not accessible from IntrinsicObjectModel or IntrinsicStraturedArray may want to declare intrinsic fields, structured arrays or inner classes with such fields or arrays using that accessible-only-to-it constructor. This will not be possible with the current API.

My hope is to address such situations in Java 7 and beyond with method handles. Unlike reflective calls to constructors, which have their accessibility checked at invocation time based on the calling class, Method handle based calls to constructors have the accessibility checked at lookup time. A class with access to a certain constructor can therefore provide a method handle to that constructor in a way that can be executed by IntrinsicObjectModel or IntrinsicStraturedArray.

Will update this issue when we make more progress.

Detect the object memory bloat issue

Hello,

We built a profiler and our profiler reports a problematic object (array intAddressableElements) in AbstractStructuredArrayBase.java file. The life cycles of different instances do not overlap, which means using a singleton pattern of this object (i.e., allocating a single object instance and reusing it without creating more instances) is safe and avoids memory bloat. To apply the singleton pattern, we can hoist intAddressableElements allocation out of allocateInternalStorage method, which is thread-safe.

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.