Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6819799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:20:57+00:00 2026-05-26T21:20:57+00:00

I am developing a web app in Rails that needs to perform computationally intensive

  • 0

I am developing a web app in Rails that needs to perform computationally intensive data lookup and processing when responding to a request.

I have written a ruby C extension that performs this computation, but to speed things up even greater, I need to create an index.

To keep the index fast, I want to simply use a hash table in C in memory. This hash table will be large. On the order of .5 – 1 GB of memory. I have thought about using a database but I need a very specific format for this index, and ultimately a hash table is fairly simple, and will be very fast.

The index needs to be able to do two things:

1) respond to look up requests
2) respond to requests to add items to the index without having to restart the program

I would prefer to not write a full on C server to build and manage this index.

Is there a way that I can write a ruby C extension with the above two methods, that persists the index in memory in-between calls of the extension?

Is there another way to achieve what I need above without writing a full on server in C?

Worst case, I can write a C server that my rails app can talk to, but I was hoping to find something simpler.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:20:58+00:00Added an answer on May 26, 2026 at 9:20 pm

    I think hashing has been solved many times. Some flavor of MemcacheD or Redis.
    Running it on localhost should make it very fast and persistent (with respect to your app). Redis also has options to back your cache to disk every N updates or N minutes if you really want to keep it.

    I would do the heavy lifting in C to calculate said expensive thing. Then stick it in Memcache/Redis when I got it back in Ruby.

    If you need to put it in Memcache/Redis while in C, I believe both are written in C so leveraging the libraries shouldn’t be too hard.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web app (using rails) that I will be launching within
I'm developing web app that user can save his/her work to server. The data
We are developing a web app that will have a pretty complex user and
I am co-developing a simple web app in Rails 3.0.9 and I have realized
Im developing a Rails app that will contain a web front end as well
I am developing a web app that accesses some external JSON data. I'm currently
I'm developing a web-app in Rails using jQuery where a lot of the processing
I'm developing a web app that needs to use HTML5 websockets. Is there any
I am developing a web app using servlets and jsps. I have a question
I am developing a web app but is not satisfied with is architecture that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.