简体   繁体   中英

Xls (csv) or xml for rails importing data

I need to import data to my app, now i do it via xls spreadsheets, but when in my case it has about 80.000 rows it is slow, so maybe is it better to chose another format? For example, will xml data be more faster in importing?

XML is unlikely to be any faster - it still needs to be parsed as strings and converted.

80,000 rows is quite a lot. How long does it take you?

Edit:

You can make what's happening more visible by dropping puts statements into your code, with timestamps. It's crude, but you can then time between various parts of your code to see which part takes the longest.

Or better yet, have a go at using ruby-prof to profile your code and see where the code is spending the most amount of time.

Either way, getting a more detailed picture of the slow-points is a Good Idea. You may find there's just one or two bottlenecks that can be easily fixed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM