Skip to content

Improve conventions usage in the examples and add comments #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

purbon
Copy link
Contributor

@purbon purbon commented Aug 27, 2015

Hi,
in this PR I tried to:

(disclaimer: I'm not sure why git delete&create a new file when doing the Foo -> RubyFoo rename, I apologies for the inconvenience).

Relates to #1

* This class is used when to run the instanciation and load
* of all the related modules and classes defined here.
* This class is used to load all related modules in a lib (metaphor in the extensions mechanism).
* Everything defined in the load method would be instantiated when teh ruby code does the require
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

teh -> the

@mkristian
Copy link
Member

not sure if this is the right spot to put my 2 cents to it:

https://github.com/jruby/jruby-examples/blob/master/extensions/basic/lib/basic.rb#L4

is a very expensive feature of the LoadService since it means on each not found it looks on the classloader to a find class with a specific name, since the require can have an absolute file name it needs to do linear search of names.

requiring a jar does trigger the classname search. currently the classnames search even happens once before loading the jar (https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/runtime/load/LibrarySearcher.java#L73) and then again after the jar file is added to the classloader (https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/runtime/load/LibrarySearcher.java#L313).

IMO declaring an extension more the java way like jruby/jruby#2987 and not searching for a java class on any missed require will improve the LoadService. rubygems does its activation of gems also on missed required as well - so our missed require might not a miss after rubygems did its job.

@kares
Copy link
Member

kares commented Mar 12, 2018

seems like this is out of date for the time being ... maybe at this point its best closed?

@monkstone
Copy link
Contributor

I agree, plus it would be a wasted effort to resolve conflicts

@kares kares closed this Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants