[ndc 2014] 던전앤파이터 클라이언트 로딩 최적화

81
던던 던 던던던 던던던던던 던던 던던던 " 던던 던던던 3 던 던던던던던 !" NEOPLE 던던던

Upload: jaeseung-ha

Post on 17-Dec-2014

4.408 views

Category:

Technology


11 download

DESCRIPTION

NDC 2014 던전앤파이터 클라이언트 로딩 최적화 발표 자료 - 데이터 분할 압축 - 로딩 속도 개선을 위한 dumpable 라이브러리 - 이미지 미리읽기 리스트 - 그 외 개선 사항들

TRANSCRIPT

  • 1. " 3 !" NEOPLE

2. Ymir Entertainment - 2 NEXON - NCSOFT NEOPLE- Dungeon & Fighter TAOMP 3. 4. Dumpable TBB malloc 5. 6. 8 7. 54, 300MB 1000 , 4.1GB SSD 2GB 8. HDD 9. HDD 10. : , goo.gl/0Xxm7b 11. Dumpable TBB malloc 12. 13. , 54, 642MB XML 30 Binary XML 300MB 14. Memory mapped file XP SP2 memory mapped file 15. 22MB ? ! 16. BLOCK = 64*1024 total = 0 for i in xrange(0, len(data), BLOCK): total += len(zlib.compress(data[i:i+BLOCK], 9)) total ~ 55MB - 64KB 17. - 35MB 54 18. 100MB - mmap ~10ms 64KB ~ 0.5ms ( ) SSD ~ 0.5ms 19. Dumpable Serialization without any serialization codes in C++ 20. 50% (27) = 2000 21. ? () (body.ani -> CAnimation::Load) string, vector 22. class POD struct (http://en.wikipedia.org/wiki/Plain_old_data_structure) std::string, std::vector string vector ? std::string name 23. valid . 24. void serialize(Archive & ar, const unsigned int version) { ar & degrees; ar & minutes; ar & seconds; } // boost::serialization Reflection C++ 25. Dumpable http://github.com/ipkn/dumpable struct Casting 26. struct student { dwstring name; int score; }; struct classroom { dstring class_name; dvector students; }; 27. classroom data; data.class_name = "1001"; data.students.emplace_back(L"Alice",2); data.students.emplace_back(L"Bob",5); data.students.emplace_back(L"ud55cuae00",13); ostringstream out; dumpable::write(data, out); // out.str() 28. // (char*) buffer , const classroom* pClassRoom = (classroom*)buffer; // // 29. dumpable // // . classroom x; stream.Read(x.class_name); Uint32_t count; stream.Read(count); for(int i = 0; i < count; i ++) { student s; stream.Read(s.name); stream.Read(s.score); x.students.push_back(s); } 30. Serialization memcpy Header-only library 31. classroom class_name4 1001 students34 Dumpable struct student { dwstring name; int score; }; struct classroom { dstring class_name; dvector students; }; 32. deserialize 33. 1 , 2, 3 34. Dumpable (*) * . 35. Dumpable T* dptr operator* overloading dstring, dvector dptr 36. classroom class_name4 1001 students34 dumpable::write struct student { dwstring name; int score; }; struct classroom { dstring class_name; dvector students; }; 37. dumpable::write (1) 1. pool 2. pool 3. 38. Dumpable::write template void write(const T& data, std::ostream& os) { T x; dpool local_pool(&x, sizeof(T)); dumpable::detail::dptr_alloc() = [&local_pool] (void* self, dumpable::size_t size) ->std::pair{ return local_pool.alloc(self, size); }; x = data; os.write((const char*)&x, sizeof(x)); local_pool.write(os); dumpable::detail::dptr_alloc() = nullptr; } 1 2 3 39. Dumpable::write template void write(const T& data, std::ostream& os) { T x; dpool local_pool(&x, sizeof(T)); dumpable::detail::dptr_alloc() = [&local_pool] (void* self, dumpable::size_t size) ->std::pair{ return local_pool.alloc(self, size); }; x = data; os.write((const char*)&x, sizeof(x)); local_pool.write(os); dumpable::detail::dptr_alloc() = nullptr; } 1 2 3 Pool stream 40. dumpable::write (2) dstring operator = pool dptr = = 41. classroom class_name4 1001 students34 dumpable::write struct student { dwstring name; int score; }; struct classroom { dstring class_name; dvector students; }; 42. ! 43. - (+) () 44. ? ? * . . 45. 46. () 4 47. ( ) 48. http://www.youtube.com/watch?v=l3Pd3hZP2vA 49. ! + 50. : define if ( == SKILL_EXCALIBUR) character/swordman/animation/excalibur/excalibur_sw ord_start_%s_%s_glow.ani * . 51. 52. 53. , , , 54. csv 15GB 7750 140 55. (1) . 56. (1) () : ! : 57. (2) - 2D , / body/RandomKick.ani face/RandomKick.ani */RandomKick.ani 58. (3) - ! 59. 60. (1) A A 61. (2) GrabBlastBlood.ani 322, 0~1 308(95%), 5~19 14 0.767, 2.59 Outlier ? 62. (3) 63. , , 64. (1) , 65. (10% ) 66. , 1 1GB 67. , std::map , TBB malloc, 68. 4 1000 8 2 ( ?) 69. 2 ( 4GB) 70. 2 20 71. std::map std::map boost::unordered_map VS 2010 unordered_map boost::unordered_map std::unordered_map 72. TBB malloc VC++ CRT malloc TBB scalable_malloc 10% 73. primitive type 10-20% 2 -> 0.5 74. 5/15 75. VS 76. () : : ? ! ! ! 77. , 78. Q&A Dumpable TBB malloc 79. . " " NDC 2008 " NDC 2013