Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #12385 (new)

Opened 5 years ago

Last modified 3 years ago

Unnecessary thread safety from Vector?

Reported by: mtbcarroll Owned by: mtbcarroll
Priority: minor Milestone: Unscheduled
Component: Bio-Formats Version: 5.0.2
Keywords: improvement Cc: bf@…
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description

Bio-Formats uses Vector in plenty of places where I wonder if we don't need the synchronization overhead. Perhaps ignoring components like bio-formats-plugins and forks, I'd be happy to open PRs to try changing the code in autogen and the readers and suchlike to use ArrayList if that's judged desirable. Will await comment before actually going for it.

Change History (9)

comment:1 Changed 5 years ago by mtbcarroll

To avoid breaking external code, I do not know if things like services' getAttributeList(), getDocumentList(), getVariableList() would have to keep returning Vector<String> instead of List<String>.

comment:2 Changed 5 years ago by mlinkert

I think it's fine to do this for internal usage of Vector, but maybe not in places where it will change public API unless there is a very good reason.

comment:3 Changed 5 years ago by mtbcarroll

Hashtable may also be a target.

Last edited 5 years ago by mtbcarroll (previous) (diff)

comment:4 Changed 5 years ago by mtbcarroll

Hashtable turns out not to be much of a viable target: it is too much part of the metadata API to be changed at the moment.

comment:5 Changed 5 years ago by jamoore

Hmmmm....would be interesting to scope what all will break. Uses in scripting languages may just keep working (MATLAB, IJ macros, etc)

comment:6 Changed 5 years ago by crueden-x

If backwards compatibility is an issue, why not deprecate the old API and add new methods with the more modern Collections API types?

comment:7 Changed 5 years ago by jburel

  • Keywords improvement added

comment:8 Changed 5 years ago by mtbcarroll

crueden-x: Good idea. I wonder when would be the best time to do so.

Note: In replacing Stack with Deque, note that this reverses the collection's natural iteration order.

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.83094 sec.)

We're Hiring!