Articles tagged 'performance'

  • Unit Testing ActiveRecord eager-loading

    January 27, 2016

    If you’ve worked with relational databases and any ORMs like Java’s Hibernate, .NET’s NHibernate or Rails’ ActiveRecord in the past, you might be familiar with SELECT N+1 issues. It is a common performance problem in database-dependent applications and, because of this, these ORMs provide a built-in solution to this problem.

    In ActiveRecord, includes, preload and eager_load come to the rescue. Therefore, it is not unusual to find these keywords scattered in different places where your application accesses the database. Hopefully this isn’t a lot of places though - you are using Query Objects, right?

    An example application

    Let’s imagine for a second that we have an application where you can browse restaurants, which in turn have many reviews...

    Continue Reading →

  • New homepage for Rambling Trie

    July 28, 2012


    This post was originally published in the Rambling Labs Blog on July 28, 2012.


    As done with the jQuery Rambling Slider previously on this week, and as I promised on that post as well, the Rambling Trie now has its own homepage on ramblinglabs.com! Here’s the link:

    Rambling Trie | A Ruby implementation of the Trie data structure

    It features installation and usage steps as well as a contributing page, and includes the badges from various cool GitHub services (more on that later). It also has a brand new logo, inspired on the trie data structure (and other tree data structures) concept.

    Go ahead and check it out!

    Still pending:

    • Examples page for jQuery Rambling Slider
    • Examples page for Rambling Trie
    • Examples page for Rambling Slider...

    Continue Reading →

  • Rambling Trie 0.4.1 is out!

    July 21, 2012


    This post was originally published in the Rambling Labs Blog on July 21, 2012.


    Version 0.4.1 of the Rambling Trie is here. It has some minor performance improvements over previous versions, changes in file/directoy structure, as well as a new API entry point, other API methods and more documentation.

    You can now instance a new trie like this:

    trie = Rambling::Trie.create
    

    DEPRECATION WARNING

    The old API entry point Rambling::Trie.new is now marked as deprecated and will be removed soon. Use the new Rambling::Trie.create method.


    Also, you can add words to the trie using <<:

    trie << 'word'
    

    And check if a word is contained in the trie with include?:

    trie.include? 'word'
    

    You can see more documentation available on the project’s...

    Continue Reading →

  • Rambling Trie 0.3.3 has been released!

    February 13, 2012


    This post was originally published in the Rambling Labs Blog on February 13, 2012.


    The new version of the rambling-trie gem is out! As I said on my previous post, the rambling-trie is an implementation of the Trie data structure in Ruby.

    Version 0.3.3 has several performance improvements, and I also added the code’s documentation via Yard. Also, since the previous version (0.3.2), the methods has_branch_for? and is_word? have been fixed for the compressed trie.

    For the uncompressed trie, the has_branch_for? and is_word? methods work very fast. The compressed trie’s is_word? method is as fast as it’s uncompressed counterpart, but the has_branch_for? is a bit slower.

    I’ve also added some benchmarking reports for each version of the...

    Continue Reading →