Comments (9)
Patrick, precompile what?
from jrubyfx.
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.
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.
yea, that was my idea. We have two parts:
- stuff similar to what we have now, except it ouptuts ruby code
- 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.
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.
WIP can be found at https://bitbucket.org/byteit101/jrubyfx but needs to be transformed into rakefile.
from jrubyfx.
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.
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.
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)
- jrubyfx sensitive to number of spaces in fxml HOT 2
- Enhancement: Provide Ruby binding impls HOT 1
- Setting TableView items doesn't seem to work HOT 4
- Jar classpath issue on windows HOT 1
- jarify with fxml: no .jrubyfx_cache in the jarfile HOT 1
- jarify with fxml: cannot access the fxml files
- jarify with fxml: require_relative doesn't work from inside a jarfile
- jrubfx-jarify compiled jar does not laucnch HOT 5
- cannot run the hello world app HOT 2
- gem install jrubyfx gem not found HOT 1
- Permission denied for 'jrubyfx_cache' HOT 2
- Need more documentation for controller functions HOT 1
- jrubyfx não encaminhando HOT 2
- Is this project active ? HOT 3
- Path to jfxrt.jar loading issue with 1.8.0_202-ea-b03 HOT 1
- Would it be possible to add a screenshot-example to the main README here? HOT 1
- Use javafx 17 modules HOT 3
- Warning: SCENE3D? HOT 1
- More examples perhaps? TextArea specifically
- Classic OOP style? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jrubyfx.