-
-
Notifications
You must be signed in to change notification settings - Fork 925
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ea3d617dc860
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0180583c278b
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
1
contributor
Commits on Jun 30, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 7488347 - Browse repository at this point
Copy the full SHA 7488347View commit details -
Configuration menu - View commit details
-
Copy full SHA for f541c3b - Browse repository at this point
Copy the full SHA f541c3bView commit details -
Wire up 1-obj arrays and unify some construction paths.
This is not yet running properly.
Configuration menu - View commit details
-
Copy full SHA for c2f3ce3 - Browse repository at this point
Copy the full SHA c2f3ce3View commit details -
Configuration menu - View commit details
-
Copy full SHA for b47a8af - Browse repository at this point
Copy the full SHA b47a8afView commit details -
Configuration menu - View commit details
-
Copy full SHA for 51eb164 - Browse repository at this point
Copy the full SHA 51eb164View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d10abf - Browse repository at this point
Copy the full SHA 3d10abfView commit details -
Configuration menu - View commit details
-
Copy full SHA for b81e3ca - Browse repository at this point
Copy the full SHA b81e3caView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ae5f8f - Browse repository at this point
Copy the full SHA 0ae5f8fView commit details -
Implement two-object specialized arrays, plus misc improvements.
* Reduce #unpack logic. * Pull a couple more methods up to RubyArray with accessors. * Document specialized array classes. * Eliminate flag; null values field is good enough (maybe better).
Configuration menu - View commit details
-
Copy full SHA for 793815e - Browse repository at this point
Copy the full SHA 793815eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 76fe2c2 - Browse repository at this point
Copy the full SHA 76fe2c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 93f0c02 - Browse repository at this point
Copy the full SHA 93f0c02View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cf6e65 - Browse repository at this point
Copy the full SHA 5cf6e65View commit details -
Configuration menu - View commit details
-
Copy full SHA for e5776b5 - Browse repository at this point
Copy the full SHA e5776b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2336f2c - Browse repository at this point
Copy the full SHA 2336f2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a15447 - Browse repository at this point
Copy the full SHA 3a15447View commit details -
Add new mechanism for visiting all Hash elements without alloc.
This new mechanism passes in state that makes most Visitor construction unnecessary: thread context, currently-visiting Hash, and a generic state object.
Configuration menu - View commit details
-
Copy full SHA for b6739cf - Browse repository at this point
Copy the full SHA b6739cfView commit details -
Use new visitor logic everywhere.
Nearly all of these are now allocated once, like a lambda. A few require more state to be passed in than is reasonable for a generic visitor, or require state to be calculated during visit and retrieved at the end. These cases were at least reduced to only allocate a visitor, rather than a visitor and a state-holding object.
Configuration menu - View commit details
-
Copy full SHA for cfab498 - Browse repository at this point
Copy the full SHA cfab498View commit details -
Deprecate old visitAll to prevent mix-ups.
See MapJavaProxy's RubyHashMap subclass; it previously override the old visitAll, which broke Map instances returned from Java because that visitAll was not being used. This will help ensure no subclasses are overriding the wrong method. I don't expect there's many (or maybe any) other cases in the wild.
Configuration menu - View commit details
-
Copy full SHA for 540a491 - Browse repository at this point
Copy the full SHA 540a491View commit details -
Utilize packed 1-2 elt arrays more places in the codebase.
This commit includes a pass over our code to improve places where we are creating one or two-element arrays via the IRubyObject[] paths, so they will use packed arrays when possible. I did this survey by applying the patch (below) and running ruby/spec, various gem commands, and starting up and hitting a blank rails application. The pattern used for most of these changes is as follows: * Allocate a new "blank" array with RubyArray.newBlankArray(size). * Popululate at least the first 'size' elements. This is necessary since the packed arrays can only represent exactly one or two elements, and must be unpacked to represent other sizes. Most cases found in the survey were updated to this new pattern and now will create packed forms. Notable exceptions that I skipped (usually due to algorithms that had unpredictable sizing) were: * RubyString.enumerate[chars,codepoints] - Because of the variable width of characters in multibyte, this logic was difficult to connect up to an "exactly this size" array. It should be possible to use packed arrays for 7-bit cases, or to be smarter about small strings with one or two codepoints, but I have not attempted that here. * RubyArray.values_at - Because the incoming arguments may not represent exactly how many items will be pulled from the array (e.g if you pass in a Range). * RubyStruct.values_at - Same reasons as for RubyArray.values_at. * SelectExecutor's construction of result arrays - Because some or all of the expected channels may not be ready, it would require more logic to right-size the arrays. This is a heavily- hit piece of logic and such an improvement may be warranted, but there's significantly more overhead in SelectExecutor that needs a rewrite before packed arrays would show any significant improvement. The patch mentioned above follows. ```diff diff --git a/core/src/main/java/org/jruby/RubyArray.java b/core/src/main/java/org/jruby/RubyArray.java index d2bc419..180af8f 100644 --- a/core/src/main/java/org/jruby/RubyArray.java +++ b/core/src/main/java/org/jruby/RubyArray.java @@ -160,26 +160,30 @@ public class RubyArray extends RubyObject implements List, RandomAccess { /** rb_ary_new2 * */ public static final RubyArray newArray(final Ruby runtime, final long len) { + if (len == 1 || len == 2) Thread.dumpStack(); checkLength(runtime, len); return newArray(runtime, (int)len); } public static final RubyArray newArrayLight(final Ruby runtime, final long len) { + if (len == 1 || len == 2) Thread.dumpStack(); checkLength(runtime, len); return newArrayLight(runtime, (int)len); } public static final RubyArray newArray(final Ruby runtime, final int len) { + if (len == 1 || len == 2) Thread.dumpStack(); RubyArray array = new RubyArray(runtime, len); Helpers.fillNil(array.values, 0, len, runtime); return array; } public static final RubyArray newArrayLight(final Ruby runtime, final int len) { + if (len == 1 || len == 2) Thread.dumpStack(); RubyArray array = new RubyArray(runtime, len, false); Helpers.fillNil(array.values, 0, len, runtime); return array; } ```
Configuration menu - View commit details
-
Copy full SHA for 54218a3 - Browse repository at this point
Copy the full SHA 54218a3View commit details
Commits on Jul 5, 2016
-
Propagate packed arrays to IRubyObject[] factory methods.
This commit introduces a few new RubyArray.newArray factory methods that are aware of packed forms and can produce the most memory-efficient RubyArray possible. RubyArray.newArrayMayCopy takes an array and will either construct a packed copy of the first one or two elements or a COW-shared array viewing the original. The expectation is that the given array is "effectively read-only", so it can be owned or discarded by the factory method at will. There are new RubyArray.newArray forms for three and four elts. Only the one and two-elt versions use packed forms. Several calls through Ruby.newArray utility methods were moved to new or existing RubyArray factory methods. All specs pass with these changes, and many cases that created "heavy" arrays before will now create packed arrays. This is particularly useful for splatting one or two arguments into an array. A quick benchmark of "def foo(*a); a; end" five times in a 1M iteration loop shows 15-20% improved performance for both one and two-argument calls.
Configuration menu - View commit details
-
Copy full SHA for 5f37238 - Browse repository at this point
Copy the full SHA 5f37238View commit details
Commits on Jul 6, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 6bdcd7a - Browse repository at this point
Copy the full SHA 6bdcd7aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7998429 - Browse repository at this point
Copy the full SHA 7998429View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0180583 - Browse repository at this point
Copy the full SHA 0180583View commit details
There are no files selected for viewing