Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: josa 함수의 계산과 분기를 최적화하였습니다 #282

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

iamhungry1030
Copy link
Contributor

Overview

  1. 분기 순서를 변경하더라도 로직엔 영향을 주지 않아 간단한 분기에서 early return 하도록 변경하였습니다.
  2. 로 조사를 Set으로 변경하여 O(1)로 시간복잡도를 최적화하였습니다.
  3. index = index === 0 ? 1 : 0로 분기하던 부분들을 has받침을 사용하도록 수정하였습니다.

PR Checklist

  • I read and included theses actions below
  1. I have read the Contributing Guide
  2. I have written documents and tests, if needed.

Copy link

changeset-bot bot commented Nov 16, 2024

⚠️ No Changeset found

Latest commit: 553793a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Nov 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
es-hangul ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 16, 2024 6:49am

@iamhungry1030 iamhungry1030 changed the title josa 함수의 계산과 분기를 최적화하였습니다 chore: josa 함수의 계산과 분기를 최적화하였습니다 Nov 16, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.53%. Comparing base (0a60a65) to head (553793a).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #282   +/-   ##
=======================================
  Coverage   99.53%   99.53%           
=======================================
  Files          38       38           
  Lines         642      644    +2     
  Branches      156      158    +2     
=======================================
+ Hits          639      641    +2     
  Misses          3        3           

@okinawaa
Copy link
Member

okinawaa commented Nov 16, 2024

너무 좋은 기여 감사해요
제가 코드내에 있는 벤치마크를 이용해 기존 josa와, 작성해주신 개선이 된 josa함수를 벤치마킹 해보았는데요,

실행 input에 따라서도 결과가 다르고 둘 중 어느 코드가 더 빠르다는 제가 아직 검증을 못하였어요.
개선해주신 새로운 josa 코드가 더 빠르다는것을 어떻게 확인할 수 있을까요~?

1 2 3
image image image

위 이미지의 es-hangul은 기존조사, es-hangul-new-josa는 작성해주신 개선된 josa 함수입니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants