What is the fastest way to create DMatrix?

Hello! I’m working on converting our internal columnar data format to DMatrix. Can you please tell me, what is the best way to do that? Also, is there any documentation of DMatrix memory layout?
Thanks!