Charles Oliver Nutter

Results 1211 comments of Charles Oliver Nutter

Could you re-target this at the jruby-9.4 branch? We are still maintaining that version and ideally all of these fixes would go there first and be merged forward to 10/master.

Looks like it's using refinements for some numeric operations, which is doubly bad because it defeats our other numeric optimizations **and** refinements are totally unoptimized at present. A trace from...

Refinement of Numeric is likely the largest problem here, since it breaks almost all of our optimizations for numeric operations.

Replacing the refinement with a hard monkey patch eliminates most of the numeric overhead, with numbers approaching 1.3s at times. The new culprit is millions of calls to this `width`...

The top two methods in a JMC profile appear to be two blocks. Here in `TextLayouter.call`: https://github.com/gettalong/hexapdf/blob/6cd6dccbc885a5e0c13b060af2a726b20325e727/lib/hexapdf/layout/text_layouter.rb#L231 and here in `TextLayouter#fit`: https://github.com/gettalong/hexapdf/blob/6cd6dccbc885a5e0c13b060af2a726b20325e727/lib/hexapdf/layout/text_layouter.rb#L746 They are quite big so it will require...

Strangely, running with `-X+C` causes a `NoMethodError` where there should not be one: ``` $ jruby -X+C benchmark.rb jruby 10.0.1.0-SNAPSHOT (3.4.2) 2025-07-07 7c668aba88 OpenJDK 64-Bit Server VM 21.0.5+11-LTS on 21.0.5+11-LTS...

Bug was introduced at 4b897eec13b4d468ee438885d81ddba16d02aebc but is hidden at boot because Hexpdf has a `rescue nil` that captures too much. ``` Unhandled Java exception: java.lang.ArrayIndexOutOfBoundsException: Index 17 out of bounds...

The `flag` bug is fixed in #8896.

Please check the syntax and re-target against jruby-9.4 branch. Thank you for your help!

I'm not sure this is exactly the right fix. Looking through all callers, it seems like they all actually just pass in `int`. This probably was a refactoring gone bad....