Path: csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Jim Janney Newsgroups: comp.lang.java.programmer Subject: Re: JNA performance Date: Mon, 09 May 2011 08:54:21 -0600 Organization: As little as possible Lines: 26 Message-ID: <2psjsnncv6.fsf@shell.xmission.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="dZdavj/jUDynNQgDq5jkeA"; logging-data="31564"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QpKlXuioUVjPriK9lUHMq" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Xd9wQoVtmGTjvN6zJGhhMSUJrIk= sha1:8LLfUJsRF08cOTHHfScO37n4X2k= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3857 "Qu0ll" writes: > I am about to do some Java programming involving native libraries so > can anyone comment on their experiences with the performance of JNA? > I note the following (somewhat concerning) statement from the JNA > website: > > "While some attention is paid to performance, correctness and ease of > use take priority." > > I guess there's little point in using it if it sucks performance-wise > even if it is "easy to use"! I have never used JNI either but it > looks not so "easy to use" (i.e. requires some C programming). I haven't tried JNA -- it either didn't exist or I didn't know about it when I needed it -- but it looks attractive. I would start with JNA and then decide what to do if performance turns out to be a problem. JNI depends very much on the size of your project. If you're only calling a few functions it isn't too bad, but there's a lot of boilerplate code needed, which is easy to get wrong and hard to read. For larger projects SWIG does a decent job of generating code automatically. -- Jim Janney