Giter Club home page Giter Club logo

Comments (9)

enebo avatar enebo commented on July 24, 2024

Patrick, precompile what?

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

the injections: https://github.com/jruby/jrubyfx/blob/master/lib/jrubyfx/dsl.rb#L183

If "compile" them down to a file that looks like

def Java::whatnot
  def setColor(x)
     # code
  end
end

this is much faster to load than reflecting over evrything again and class << self; define_method'ing

from jrubyfx.

enebo avatar enebo commented on July 24, 2024

ahhh I see yeah we are not using Java reflection per se but we are using JI reflective methods to create those converters. When you first said this I thought you meant using jrubyc to make .class files. That is virtually never faster than loading a .rb. What you suggest would definitely be faster. It might be nice for us to make a declarative file describing all these conversions and then have a rake task to generate them. Then we can regenerate if we end up changing some stuff more easily?

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

yea, that was my idea. We have two parts:

  1. stuff similar to what we have now, except it ouptuts ruby code
  2. declarative file to let us fix stuff on indivdual basis

and this is possible since the javafx api is fairly stable and does not change run to run

I've wanted to do the second for a while, but never got around to it. But now that we have the ruby FxmlLoader (btw, the ruby version is FxmlLoader, java is FXMLLoader to easily distinguish), its even slower than before, so I'm usually waiting 20 or so seconds for my awesome shiny app to show up. Also FxmlLoader does not use JRubyFX stuff, so it might be possible to load in parallel. I should also get rid of the 1MB of debug spew to make it faster :D. Random aside: whenever I get around to testing it, I can add ruby script support to FXML files (not just javascript anymore)

from jrubyfx.

enebo avatar enebo commented on July 24, 2024

It seems like anything which is wrapping an existing method in FX should be in the declarative space and generated and individual helper additions to a FX builtin class should be in their own place probably laid out like they are now. Startup is somewhat dependent on # of parsed files so we might need to play with reducing files as an experiment, but I prefer to hack away on things like you noticed in this issue (JI reflection is a time sink) before getting down to that level of optimization. Especially lazy setup of FX classes since most FX classes are not used in most FX apps.

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

WIP can be found at https://bitbucket.org/byteit101/jrubyfx but needs to be transformed into rakefile.

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

I have a mostly working version with rakefile (rake reflect, automatically called on gem and install also) pushed to master, but it appears I have broken some things. Namely, group {whaever} is always empty. I traced this down to overzealous enum overrides.It appears that opening a class wipes out java class heirarcy overloads and as such, if we overload the enums in Group, we must overload EVERYTHING!

Needless to say the fix is easy conceptually: don't override subclasses with the same methods or do override everything all the time.

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

Ok, that is solved and it cut down the size of the generated files quite a bit.

Still left to do:

  • Imports (java_import's)
  • DSL mappings

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

Imports and DSL mappings are done, just would like to add a few more things like color and maps. notes on what is still not in the procompiling:

borderPane:
alias left right top bottom center method_missing (node_method_missing)

ColumnConstraints:
new converter with a map (non-enum)

DragEvent:
enum converter!!!
alias accept transfer modes

Duration/Numeric:
5.ms methods

Drop Shadow.:
color converter, new with color and enum

FileChooser:
code

imageView:
rectangle2d converter

labeled:
color!

MediaPlayer:
map converter (int + special)

ObservableValue:
add_change_listener: TODO: investigate

Pagination:
map (int + indeterminate special value)

Path:
More complex m_m

ProgressIndicator/Bar:
map converter + int

Gradients:
enum in new

Region:
map converter (int + special)
insets converter

Rotate:
map converter

Scene:
color converter

Stage:
code

Stop:
color!

TableView:
map!

Timeline:
code
map

Transition:
animation convertsr

TreeView:
some code

XYChart:
adding stuff

from jrubyfx.

Related Issues (20)

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.