æ°ããªææŠã®æºåã¯ã§ããŠããŸããïŒ é«è² è·ã®ãµãŒãã¹HighLoad CupïŒ2ã®èšèšãšç®¡çã®ããã«ããã¹ãŠã®ã¢ããã¥ã¢ãšããããã£ã³ããªã³ã·ããã«æåŸ ããŸãïŒ
競äºã¯æšå¹Žéå§ãããŸããã ãããŠãHighLoad Cupã¯ãå€ãã®Mail.Ru Groupãããžã§ã¯ãã§æ¬ ããŠãããã£ã³ããªã³ã·ããã§ããããšãç¥ã£ãŠããŸããã æåã®ãã€ããã競æã«ã¯449人ãåå ããŸããã äž»å¬è ãšåå è ã®äž¡æ¹ã«å€ãã®ã³ãŒããšå€ãã®æ±ããããŸããïŒ8789ã®ç°ãªããœãªã¥ãŒã·ã§ã³ïŒã æè¡çãªå®è£ ã«ã¯åŸ®åŠãªéãããããŸããããæãéèŠãªããšã¯ã誰ãããããæ°ã«å ¥ã£ãŠããããšã§ãïŒ ãªãŒã¬ãã€ã¶ãŒã¯ããŒã¿ã»ã³ã¿ãŒã§äœæ©ãéããããªãã£ã¹ã§æ°æ¥éäŒã¿ãŸããã åã³æºåãã§ããŸããïŒ èšäºã®æåŸã«ãç§ãã¡ãšåå è ããã®æçšãªè³æããããŸããããã¯ãã¡ã«ããºã ãç解ãããã¹ããã©ã¯ãã£ã¹ã®ãœãªã¥ãŒã·ã§ã³ãèŠã€ããã®ã«åœ¹ç«ã¡ãŸãã
ä»åã圌ãã¯ããªãã®ããã«ãããå°é£ãªããžãã¹ãæºåããããšããŸããã ããã«ãèŠèŽè ãæ¡å€§ããè±èªã話ããŠãŒã¶ãŒãã³ã³ãã¹ãã«åå ã§ããããã«ãªããŸããã Telegramã§ãã·ã¢èªã話ãã³ãã¥ããã£ã«åå ããŠãã ããã ããã§ã¯ã競äºã«é¢ããå€ãã®æŽå¯ãåŸãããŸã:)
ãããããããïŒ
ååŠ
æšå¹Žãšæ¯èŒããŠãã³ã³ããã£ã·ã§ã³ã§ã¯æŠå¿µçã«äœãå€ãã£ãŠããŸããã
åå è ã«ã¯ãç¹å®ã®æ§é ã®ããŒã¿ãåŠçãããã®ããŒã¿ã®APIãå®è£ ããå°ããªWebãµãŒãã¹ãäœæããã¿ã¹ã¯ãäžããããŸãã å®è£ ããããµãŒãã¹ãæã€ã³ã³ããïŒDockerïŒããµãŒããŒã«ã¢ããããŒããããããã§ãµãŒããŒãèµ·åããŠHTTPãªã¯ãšã¹ãã§ã·ã§ã«ãéå§ããŸãã
ãœãªã¥ãŒã·ã§ã³ã¯ãç¹å¥ãªãªããžããªã«ããŒã«ã«ã«ã€ã³ã¹ããŒã«ãããDockerã¯ã©ã€ã¢ã³ãã䜿çšããŠéä¿¡ãããŸãïŒåã¯ã©ã€ã¢ã³ãã«ã¯ç¬èªã®ãªããžããªããããŸãïŒã ãã®åŸãéä¿¡ããããµãŒãã¹ã¯ãMail.Ru Group Technopark Laboratoryã®ã¹ã¿ãããéçºããCodeHub-CodeRunnerã·ã¹ãã ã«ãã£ãŠèªåçã«ãã§ãã¯ãããŸãã
次ã«ãIntel Core i7ããã»ããµãæèŒãããã¹ããã·ã³ã§ã³ã³ãããããã³ããŒãã§æã¡å§ããŸãã ãã®ãœãªã¥ãŒã·ã§ã³ã«ã¯ã2.4 GHzã®4ã€ã®ã³ã¢ã2 GBã®RAMãããã³10 GBã®ããŒããã£ã¹ã¯é åãå²ãåœãŠãããŸãã èŠããã«ããã¿ã³ã¯ãã¯ãã¡ã³ãã ãšã³ãžã³ã§èµ·åãããç·åœ¢ã«æé·ããè² è·ãããã¡ã€ã«ã§è€æ°ã®ã¹ããªãŒã ã§èµ·åããŸãã ã·ã§ã«åŠçã®åã«ããŠãŒã¶ãŒã®ãœãªã¥ãŒã·ã§ã³ã¯ãåä¿¡ããJSONãã¡ã€ã«ããããŒã¿ãåŠçããããã«æ°åããããŸãïŒæ£ç¢ºãªéã¯ã¿ã¹ã¯ã«ãã£ãŠç°ãªããŸãïŒã ãããã®ããŒã¿ãæ£ããåŠçããããšã¯ãåå©ã«å¿ èŠãªæ¡ä»¶ã§ãã ã·ã§ãŒããšãã³ã°ã®2ã€ã ããç ²æããŸãã
ãã®ãããªæ»æã®çµæã«åºã¥ããŠãæ£è§£ãšäžæ£è§£ã®æ°ãRPSãããã³å¿çé床ãèšç®ããç¹å®ã®ã¡ããªãã¯ã®è©äŸ¡è¡šãäœæããŸãã æéãã€æãèé害æ§ã®é«ããµãŒãã¹ã®äœæè ãåè ã«ãªããŸãã
èŠã€ãããæãã€ãããã§ãããŠã§ãæè¡ã䜿çšããŠãã ããã ç¬èªã®ããã°ã©ãã³ã°èšèªãšãã¬ãŒã ã¯ãŒã¯ãéžæããŠãã ããã C ++ãJava + TomcatãPython + DjangoãRuby + RoRãGoLangãJavaScript + NodeJsãHaskellãããã«ã¯ã¢ã»ã³ãã©ãŒãªã©ãèªç±ã«éžæã§ããŸãã ããŒã¿ã¹ãã¬ãŒãžã®å ŽåïŒMySQLãPostgreSQLãRedisãMongoDBããã£ãã·ã¥ã å®å šãªèªç±ïŒ
ã·ã§ã«åã®çµæãšããŠããã°ãšã¡ããªãã¯ãååŸããã決å®ããŒãžã«ã°ã©ã圢åŒã§åå è ã«è¡šç€ºãããŸãã åå¥ã«è¿œè·¡ïŒ
- åºæ¬çãªææš;
- æ£è§£ã
- ãªã¯ãšã¹ããžã®å¿çé床ã
- 1ç§ãããã®å¿çæ°ã
ãœãªã¥ãŒã·ã§ã³ã®è©äŸ¡ã¯æ¬¡ã®ããã«èšç®ãããŸãïŒã·ã§ã«åŠçäžã«APIã管çã§ãããã¹ãŠã®æ£ããåçã®æéãåããå¿çãåä¿¡ã§ããªãã£ãäžæ£ãªåçãŸãã¯ãªã¯ãšã¹ãããšã«ããã«ãã£æéãè¿œå ããŸãïŒããã«ãã£æéã¯åžžã«åèšãªã¯ãšã¹ãã¿ã€ã ã¢ãŠãã«çãããªããŸãïŒã åèšæéãä»ã®äººãããçãåå è ã¯ããªãŒããŒããŒãã§äžäœã«ããããã£ã³ããªã³ã·ããã®åè ã«ãªããã£ã³ã¹ããããŸãã
ææŠãã
ç§ãã¡ã®ããŒã ã¯ãä»å¹Žãã©ã®ãããªä»äºããã¹ãããé·ãéèããŠããŸããã 圌ãã¯ã倧å€æ°ã®å¯èœæ§ãå¹³æºåãããã®ãæãã§ããŸããïŒC / C ++ã®äžéšã®èªäœèªè»¢è»ãåãŠãªãããã«ïŒã
æèšã¯æ¬¡ã®ãšããã§ãã
å¥ã®çŸå®ã§ã¯ã人é¡ã¯ãåŸåãã®ã°ããŒãã«æ€çŽ¢ã·ã¹ãã ãäœæããŠèµ·åããããšã«ããŸããã ããã¯ãäžçäžã®ç¬èº«è ã®æ°ãæžããã匷ã家æãäœãã®ã«åœ¹ç«ã€ããã«èšèšãããŠããŸãã
ãã¹ããšããŸããŸãªç ²æã®ãæŠéãããŒã¿ã®äž¡æ¹ã§ã1ã€ã®ãšã³ãã£ãã£ïŒã¢ã«ãŠã³ãã«é¢ãããšã³ããªããããŸãã ãŠãŒã¶ãŒã«é¢ãããã¹ãŠã®æ¢ç¥ã®æ å ±-圌ã®ååãé£çµ¡å ãèå³ãä»ã®ãŠãŒã¶ãŒãžã®åæ ãæããã«ããŸãã æäŸãããããŒã¿ã®ç²ŸåºŠã¯ã以äžã«ç€ºãçš®é¡ãšå¶éã«åŸã£ãŠä¿èšŒãããŸãã ãã¹ãŠã®ããŒã¿ã¯ãç¹å®ã®æ³åŸã«åŸã£ãŠåœç€Ÿã«ãã£ãŠçæããã³çºæãããŸããã
次ã®å人ããŒã¿ã¯ã1ã€ã®ã¢ã«ãŠã³ãã¬ã³ãŒãã«å«ãŸããŠããŸãã
- id-ãŠãŒã¶ãŒã®äžæã®å€éšèå¥åã ãã¹ãã·ã¹ãã ã«ãã£ãŠã€ã³ã¹ããŒã«ããããµãŒããŒã®å¿çã確èªããããã«äœ¿çšãããŸãã ã¿ã€ãã¯32ãããæŽæ°ã§ãã
- email-ãŠãŒã¶ãŒã®ã¡ãŒã«ã¢ãã¬ã¹ã ã¿ã€ãã¯ãæ倧100æåã®Unicodeæååã§ãã äžææ§ãä¿èšŒãããŸãã
- fnameãšsname-ããããåãšå§ã ã¿ã€ã-æ倧50æåã®Unicodeæååã ãã£ãŒã«ãã¯ãªãã·ã§ã³ã§ãããç¹å®ã®ã¬ã³ãŒãã«ååšããªãå ŽåããããŸãã
- é»è©± -æºåž¯é»è©±çªå·ã ã¿ã€ãã¯ãæ倧16æåã®Unicodeæååã§ãã ãã£ãŒã«ãã¯ãªãã·ã§ã³ã§ãããæå®ãããå€ã«å¯ŸããŠäžææ§ãä¿èšŒãããŸãã ãŸãã«ããæºããããŸããã
- sexã¯ãŠãã³ãŒãæååã§ããmãã¯ç·æ§ããfãã¯å¥³æ§ãæå³ããŸãã
- birth-ç幎ææ¥ ãUTCã§UNIXæ代ã®åãããã®ç§æ°ãšããŠèšé²ãããŸãïŒã€ãŸããããã¯ã¿ã€ã ã¹ã¿ã³ãã§ãïŒã 2005幎1æ1æ¥ããäžã1950幎1æ1æ¥ããäžã«éå®ã
- åœ -å± äœåœã ã¿ã€ãã¯ãæ倧50æåã®Unicodeæååã§ãã ãã£ãŒã«ãã¯ãªãã·ã§ã³ã§ãã
- city-å± äœéœåžã ã¿ã€ãã¯ãæ倧50æåã®Unicodeæååã§ãã ãã£ãŒã«ãã¯ãªãã·ã§ã³ã§ããããã£ãã«æå®ãããŸããã åéœåžã¯ç¹å®ã®åœã«ãããŸãã
ãŸãã1ã€ã®ã¢ã«ãŠã³ãã¬ã³ãŒãã«ã¯ãåŸåã®æ€çŽ¢ãšã³ãžã³ã«åºæã®ãã£ãŒã«ãããããŸãã
- åå -ã·ã¹ãã ãžã®ç»é²æ¥ã ã¿ã€ã-å¶éä»ãã®ã¿ã€ã ã¹ã¿ã³ãïŒ2011幎1æ1æ¥ããäžã2018幎1æ1æ¥ããäžã
- status-ã·ã¹ãã å ã®ãŠãŒã¶ãŒã®çŸåšã®ã¹ããŒã¿ã¹ã ã¿ã€ã-次ã®ãªãã·ã§ã³ã®1è¡ïŒãç¡æãããããžãŒããããã¹ãŠãè€éã§ããã å¥åŠãªçµæ«ã«æ³šæããªãã§ãã ãã:)
- é¢å¿ -æ¥åžžç掻ã«ããããŠãŒã¶ãŒã®é¢å¿ã ã¿ã€ã-Unicodeæååã®é åã空ã®å ŽåããããŸãã è¡ã®é·ãã¯100æåãè¶ ããŸããã
- ãã¬ãã¢ã -ã·ã¹ãã ã®ãã¬ãã¢ã æéã®éå§ãšçµäºïŒãŠãŒã¶ãŒãæ¬åœã«ããœãŠã«ã¡ã€ãããèŠã€ããããšæã£ããšãã«ããµãŒãã¹ã®ä»£éãæ¯æããŸããïŒã JSONã§ã¯ããã®ãã£ãŒã«ãã¯ãéå§ãã£ãŒã«ããšçµäºãã£ãŒã«ããæã€ãã¹ãããããªããžã§ã¯ãã§è¡šãããŸããäžéãæã€ã¿ã€ã ã¹ã¿ã³ãã¯ã2018幎1æ1æ¥ã«èšé²ãããŸãã
- likes-æ¢ç¥ã®ãŠãŒã¶ãŒã®ã ãããïŒãã®é
åã空ã®å ŽåããããŸãã ãã¹ãŠã®åæ
ã¯ç°ãªã£ãŠè¡ããããããã¯æ¬¡ã®ãã£ãŒã«ãããã®ãªããžã§ã¯ããè¡šããŸãïŒ
- id-ãŠãŒã¶ãŒãæ°ã«å ¥ã£ãŠããå¥ã®ã¢ã«ãŠã³ãã®èå¥åã ã¢ã«ãŠã³ãã¯ãåžžã«IDã«ãã£ãŠãœãŒã¹ããŒã¿ã§èŠã€ããããšãã§ããŸãã ããŒã¿ã«ã¯åãIDã®ãããïŒãè€æ°ããå Žåãããããšã«æ³šæããŠãã ããã
- ts-å ±æãã·ã¹ãã ã«èšé²ãããæéãã€ãŸãã¿ã€ã ã¹ã¿ã³ãã
APIãå®è£ ããå¿ èŠããããŸãã
- ãŠãŒã¶ãŒã®ãªã¹ãã®ååŸïŒ /ã¢ã«ãŠã³ã/ãã£ã«ã¿ãŒ/
ãã®APIã¡ãœããã¯ãæ¢ç¥ã®ãã£ãŒã«ããŸãã¯ç®çã®ãã£ãŒã«ãã§ãŠãŒã¶ãŒãæ€çŽ¢ããããã«äœ¿çšããäºå®ã§ãã ããšãã°ãç¹å®ã®éœåžã«äœãã§ããç¹å®ã®å¹Žéœ¢ãšæ§å¥ã®ãã¹ãŠã®äººãèŠãããšæã£ã人ãããŸããã - ãŠãŒã¶ãŒã®ã°ã«ãŒãåïŒ /ã¢ã«ãŠã³ã/ã°ã«ãŒã/
ãã®APIã¡ãœããã¯ãã·ã¹ãã ã®åäœã«é¢ããã¬ããŒããäœæããããã«äœ¿çšãããäºå®ã§ãã ã°ã«ãŒãåã«äœ¿çšããããã£ãŒã«ãã¯ãã³ã³ãã§åºåãããããŒGETãã©ã¡ãŒã¿ãŒã§æž¡ãããŸãã ãããã¯ããŠãŒã¶ãŒãã£ã«ã¿ãªã³ã°èŠæ±ã»ã©å€ããããŸããã ã°ã«ãŒãåãããã£ãŒã«ãã¯ãæ§å¥ãã¹ããŒã¿ã¹ãèå³ãåœãéœåžã®5ã€ã ãã§ãã - äºææ§ã®æšå¥šäºé
ïŒ /ã¢ã«ãŠã³ã/ ID /æšå¥š/
ãã®ã¯ãšãªã¯ãæå®ããããŠãŒã¶ãŒããŒã¿ã®ãåŸåããæ€çŽ¢ããããã«äœ¿çšãããŸãã ãªã¯ãšã¹ãã¯ãã¹ããŒã¿ã¹ã幎霢ãèå³ã«ãã£ãŠæé©ãªãŠãŒã¶ãŒãæ€çŽ¢ããããŠãŒã¶ãŒã®IDãæž¡ããŸãã 決å®ã¯ãç°æ§ãšã®äºææ§ã®ã¿ããã§ãã¯ããå¿ èŠããããŸãïŒæ§çãã€ããªãã£ã«å察ããŠå·®å¥ãéé£ããã®ã§ã¯ãªããããŸããŸèµ·ãã£ãã ãã§ãïŒã ããããåœããŒãšéœåžããŒãæã€åœãŸãã¯éœåžãGETãªã¯ãšã¹ãã§éä¿¡ãããå Žåãæå®ããå Žæã«äœãã§ãã人ã ããæ€çŽ¢ããå¿ èŠããããŸãã - åæ§ã®ãããã®éžæïŒ/ ã¢ã«ãŠã³ã/ ID /ææ¡/
ãã®ã¿ã€ãã®ã¯ãšãªã¯ãããœãŠã«ã¡ã€ããã®æ€çŽ¢ã«é¢ãããã®ã§ããããšããç¹ã§ãåã®ã¯ãšãªãšäŒŒãŠããŸãã ãœãŠã«ã¡ã€ããæ¢ããŠãããŠãŒã¶ãŒã®IDãéä¿¡ãããå¶éGETãã©ã¡ãŒã¿ãŒã䜿çšãããŸãã å®è£ ã®éãïŒç§ãã¡ã¯ãåãæ§å¥ã§äŒŒãã奜ãããªäººãæ¢ããŠãããæè¿èªåã奜ããªäººãæäŸããŠããŸãã ãªã¯ãšã¹ããåœãŸãã¯éœåžã®GETãã©ã¡ãŒã¿ãåãåã£ãå Žåãç¹å®ã®å Žæã§ã®ã¿ãåæ§ã®åæ ããæ¢ãå¿ èŠããããŸãã
1ã€ã®èšäºã§ãã¹ãŠãäŒããããšã¯äžå¯èœã§ãã 詳现ãªã«ãŒã«ã¯ãçºå£²æ¥ïŒä»æ¥ïŒã«ãã£ã³ããªã³ã·ããWebãµã€ããšGitHubãªããžããªã«å ¬éãããŸãããããã§äœãåŸ ã£ãŠããããããããŸãã
ã¹ã±ãžã¥ãŒã«
ã¯ããç§ãã¡ã¯äŒæ¥ãæ¥ãããšãç¥ã£ãŠããŸãã®ã§ãéžææš©ã¯éåžžã«é·ããªããŸã:)
- ããŒã¿ãã¹ãïŒçµæã¯èæ ®ãããŸããïŒïŒ12æ13æ¥19:00ã«éå§ãã12æ21æ¥19:00ã«çµäºããŸãã
- äºéžã©ãŠã³ãïŒ12æ21æ¥19:00ãã1æ31æ¥19:00ãŸã§ã
- æçµã©ãŠã³ãïŒ2æ5æ¥ãŸã§ã
ããŒã¿ãã¹ãäžã«ãã¿ã¹ã¯ã®ã«ãŒã«ãšæ¡ä»¶ãå€æŽãããå ŽåããããŸãïŒãã°ãååšããå Žåãããã³ãã®ä»ã®çç±ã«ããïŒã
äºéžã©ãŠã³ã-ã«ãŒã«ã¯å€ãããŸããã
æçµã©ãŠã³ãã¯å®å šã«èªååãããŠããŸããããã®åã«ãã¡ã€ããªã¹ãïŒäºéžã©ãŠã³ãã®çµæãééããN人ã®ãŠãŒã¶ãŒãšå°ãªããšã50人ïŒããããã€ãã®æ³¢ã§æ»ãéãããããœãªã¥ãŒã·ã§ã³ãéžæããŸãã çµæã¯ããã¹ãŠã®æ³¢ã®æè¯ã®çµæã«ãã£ãŠåœ¢æãããŸãã
ãã¬ãŒã³ã
1äœã¯çæ°ããMacBook Airã§ãã
2äœããã³3äœ-Apple iPadã
4ã5ã6äœ-Samsung Gear S3ã
åå è ã¯ãèŠè¿ãã«åçã®äŸ¡å€ã®å¥ã®èŽãç©ãæ±ããæš©å©ããããŸãã 決åã«åºå Žãããã¹ãŠã®åå è ã«ã¯ããã£ã³ããªã³ã·ããã®ãã©ã³ãTã·ã£ããèŽãããŸãã
ã³ãã¥ããã£
Telegramãã£ããã«ãŒã ã«ã¢ã¯ã»ã¹ããå Žåããã§ã«é宀ããããšã¯ã»ãšãã©ãããŸããã ç§ãã¡ã¯ããªããåŸ ã£ãŠããŸãããããŠå¹žéãïŒ
è¬èŸ
ãã®èšäºã§ã¯ãã·ã¹ãã ã¢ããããŒãã®åé¡ã«ã€ããŠã¯èª¬æããŸããã ã€ã³ãã©ã¹ãã©ã¯ãã£ã®ãã°ãæé€ããããã«å€ãã®äœæ¥ãè¡ããGitHubã®åå è ããã®ãã¹ãŠã®åé¡ã確èªããæ¢ã«äœããå®è£ ããŠæ¥å¹Žã®TODOãªã¹ãã«å ¥ããŸããã Maxim @ xammi- KislenkoãIlya @liofz LebedevãEvgeny @gunicorn IvanovãIrina @aithelle LukyanovaãVasily @vasidmi Dmitrievãããã³ãã£ã³ããªã³ã·ããã³ãã¥ããã£å šäœãå«ãããŒã å šäœã«æ·±ãæè¬ããããšæããŸãã ãããããé¡ãããŸãïŒ
HighLoad Cup 2017ã®çµæã«é¢ããæçšãªæç®
èšäº
ããã¯ãšã³ãéçºè åãã®æ°ãããã£ã³ããªã³ã·ããïŒHighLoad Cup
æåã®HighLoad CupïŒã©ã®ããã«çãæ®ã£ãã®ã
HLC 2017ïŒ9äœã®æŽå²
HLC 2017ïŒ13äœã®æŽå²
HighLoad Cupã®åŸïŒphp vs node.js vs goãswoole vs workermanãsplfixedarray vs arrayãªã©
æ å
Perlã®ãããããŒããŒãã«ãã
ããã¯ãšã³ãéçºè åãã®æ°ãããã£ã³ããªã³ã·ããïŒHighLoad Cup
æåã®HighLoad CupïŒã©ã®ããã«çãæ®ã£ãã®ã
HLC 2017ïŒ9äœã®æŽå²
HLC 2017ïŒ13äœã®æŽå²
HighLoad Cupã®åŸïŒphp vs node.js vs goãswoole vs workermanãsplfixedarray vs arrayãªã©
æ å
Perlã®ãããããŒããŒãã«ãã