Advantage of uthash over glib2 hash?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Advantage of uthash over glib2 hash?

Ben Martin
Hi,
  I am wondering what advantages using uthash has over using glib2/hash?

  I know I created a double link list API a while back, before glib2 was
a fontforge dep, and hope at some stage to convert that over to using
glib2 lists instead (ie,
https://developer.gnome.org/glib/2.37/glib-Doubly-Linked-Lists.html).

  I know it's a bit of a leading question, but... Are folks happy with
trying to use the glib2 collections in fontforge? Are there better ones
that we should try to move towards?




------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
Reply | Threaded
Open this post in threaded view
|

Re: Advantage of uthash over glib2 hash?

Frank Trampe
I needed a quick hash in order to solve a big performance problem. uthash was simple (not quite so much as the front page on its website suggests), well documented, easy to implement, and compatibly licensed. And I knew that Troy would help me if I had a problem. (There were no problems.) I was very happy with the way it turned out. GLib can be a bit heavy and difficult to use in certain cases since it brings with it so much baggage, and, to be honest, I didn't know that it implemented hashes anyway.

That said, I'm perfectly satisfied with GLib doing what it currently does. I know that a few other people would like to switch to GNUlib where possible, but I don't think that this is worth the effort and trouble right now.



On Sat, Jul 26, 2014 at 2:44 AM, Ben Martin <[hidden email]> wrote:
Hi,
  I am wondering what advantages using uthash has over using glib2/hash?

  I know I created a double link list API a while back, before glib2 was
a fontforge dep, and hope at some stage to convert that over to using
glib2 lists instead (ie,
https://developer.gnome.org/glib/2.37/glib-Doubly-Linked-Lists.html).

  I know it's a bit of a leading question, but... Are folks happy with
trying to use the glib2 collections in fontforge? Are there better ones
that we should try to move towards?




------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel
Reply | Threaded
Open this post in threaded view
|

Re: Advantage of uthash over glib2 hash?

Ben Martin
On Sat, 2014-07-26 at 09:16 -0500, Frank Trampe wrote:
> I needed a quick hash in order to solve a big performance problem. uthash
> was simple (not quite so much as the front page on its website suggests),
> well documented, easy to implement, and compatibly licensed. And I knew
> that Troy would help me if I had a problem. (There were no problems.) I was
> very happy with the way it turned out. GLib can be a bit heavy and
> difficult to use in certain cases since it brings with it so much baggage,
> and, to be honest, I didn't know that it implemented hashes anyway.

Personally I like STL and boost multi indexed collections. But glib2
seems like a very common collections API if you are just using plain C.

>
> That said, I'm perfectly satisfied with GLib doing what it currently does.
> I know that a few other people would like to switch to GNUlib where
> possible, but I don't think that this is worth the effort and trouble right
> now.

I added a task so I don't forget that translating over to glib2 for
dlists might be a good idea.
https://github.com/fontforge/fontforge/issues/1576

I don't really mind what collections APIs are used. The hope is that if
many developers are already familiar with glib2 ones then it lowers the
barrier to them doing some hacking on FontForge, if only by a little
bit.

One other area that glib2 does nice things is in main loop integration.
Handing monitoring file descriptors, timeouts and such. I have added
some of this to FontForge using custom code, though that also brings
limitations and folks are not familiar with the API. Of course, cleaning
up and converting over the mainloop code opens the path for some subtle
bugs and hangs on some platforms that the custom code at the moment can
handle.



------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Fontforge-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel