YorickPeterse/ffi-aspell — pull request #16 by schmich (2014-09-04 19:22:38+00:00)
Title: (Updated) Improving performance by eliminating unnecessary speller creation and deletion

This is the alternate version of #15 using Ruby's finalizers. It definitely keeps the API cleaner.

Unfortunately, I can't think of any good tests for these changes. A GC can be forced with `GC.start`, but still, there's no guarantee that the finalizer for an object will run immediately when the object is collected (see [here](https://www.ruby-forum.com/topic/3108418)). Also, from what I see, there's no Ruby API to force the finalizers to run, so there's no way to have a dependable test.

In my manual testing on MRI, I found that finalizers will run close to object collection when other stuff happens in the program (e.g. downloading a web page), but if the system is relatively quiescent, the finalizers won't run until the end of the program. In practice, I don't think this is an issue, since the finalizer will run quickly in any programs that are doing "real stuff".

I didn't see any need to update documentation, but as always, I'm open to suggestions.